<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, NondecreasingIndentation, ScopedTypeVariables #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE TupleSections, NamedFieldPuns #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- (c) The University of Glasgow, 2005-2012</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- The GHC API</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Initialisation</span></span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.html#defaultErrorHandler"><span class="hs-identifier">defaultErrorHandler</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.html#defaultCleanupHandler"><span class="hs-identifier">defaultCleanupHandler</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#prettyPrintGhcErrors"><span class="hs-identifier">prettyPrintGhcErrors</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Utils.Panic.html#withSignalHandlers"><span class="hs-identifier">withSignalHandlers</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.html#withCleanupSession"><span class="hs-identifier">withCleanupSession</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><span class="hs-comment">-- * GHC Monad</span></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#Ghc"><span class="hs-identifier">Ghc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcT"><span class="hs-identifier">GhcT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier">GhcMonad</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier">HscEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.html#runGhc"><span class="hs-identifier">runGhc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#runGhcT"><span class="hs-identifier">runGhcT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#initGhcMonad"><span class="hs-identifier">initGhcMonad</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#printException"><span class="hs-identifier">printException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#handleSourceError"><span class="hs-identifier">handleSourceError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#needsTemplateHaskellOrQQ"><span class="hs-identifier">needsTemplateHaskellOrQQ</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Flags and settings</span></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier">DynFlags</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#GeneralFlag"><span class="hs-identifier">GeneralFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier">Severity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HscTarget"><span class="hs-identifier">HscTarget</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier">gopt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Driver.Session.html#GhcMode"><span class="hs-identifier">GhcMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#GhcLink"><span class="hs-identifier">GhcLink</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#defaultObjectTarget"><span class="hs-identifier">defaultObjectTarget</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.html#parseDynamicFlags"><span class="hs-identifier">parseDynamicFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier">getSessionDynFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier">setSessionDynFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.html#getProgramDynFlags"><span class="hs-identifier">getProgramDynFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#setProgramDynFlags"><span class="hs-identifier">setProgramDynFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#setLogAction"><span class="hs-identifier">setLogAction</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.html#getInteractiveDynFlags"><span class="hs-identifier">getInteractiveDynFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#setInteractiveDynFlags"><span class="hs-identifier">setInteractiveDynFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.html#interpretPackageEnv"><span class="hs-identifier">interpretPackageEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Targets</span></span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier">Target</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#TargetId"><span class="hs-identifier">TargetId</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#Phase"><span class="hs-identifier">Phase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.html#setTargets"><span class="hs-identifier">setTargets</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.html#getTargets"><span class="hs-identifier">getTargets</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.html#addTarget"><span class="hs-identifier">addTarget</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.html#removeTarget"><span class="hs-identifier">removeTarget</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.html#guessTarget"><span class="hs-identifier">guessTarget</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Loading\/compiling the program</span></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.Driver.Make.html#depanal"><span class="hs-identifier">depanal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Make.html#depanalE"><span class="hs-identifier">depanalE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Driver.Make.html#load"><span class="hs-identifier">load</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Make.html#LoadHowMuch"><span class="hs-identifier">LoadHowMuch</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InteractiveImport"><span class="hs-identifier">InteractiveImport</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#SuccessFlag"><span class="hs-identifier">SuccessFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#succeeded"><span class="hs-identifier">succeeded</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#failed"><span class="hs-identifier">failed</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#defaultWarnErrLogger"><span class="hs-identifier">defaultWarnErrLogger</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#WarnErrLogger"><span class="hs-identifier">WarnErrLogger</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="GHC.html#workingDirectoryChanged"><span class="hs-identifier">workingDirectoryChanged</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.html#parseModule"><span class="hs-identifier">parseModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#typecheckModule"><span class="hs-identifier">typecheckModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#desugarModule"><span class="hs-identifier">desugarModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#loadModule"><span class="hs-identifier">loadModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier">ParsedModule</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier">TypecheckedModule</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier">DesugaredModule</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="GHC.html#TypecheckedSource"><span class="hs-identifier">TypecheckedSource</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#ParsedSource"><span class="hs-identifier">ParsedSource</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#RenamedSource"><span class="hs-identifier">RenamedSource</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ditto</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier">TypecheckedMod</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier">ParsedMod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.html#moduleInfo"><span class="hs-identifier">moduleInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#renamedSource"><span class="hs-identifier">renamedSource</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#typecheckedSource"><span class="hs-identifier">typecheckedSource</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.html#parsedSource"><span class="hs-identifier">parsedSource</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#coreModule"><span class="hs-identifier">coreModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Compiling to Core</span></span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier">CoreModule</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><a href="GHC.html#compileToCoreModule"><span class="hs-identifier">compileToCoreModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#compileToCoreSimplified"><span class="hs-identifier">compileToCoreSimplified</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Inspecting the module structure of the program</span></span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#ModuleGraph"><span class="hs-identifier">ModuleGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#emptyMG"><span class="hs-identifier">emptyMG</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#mapMG"><span class="hs-identifier">mapMG</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#mkModuleGraph"><span class="hs-identifier">mkModuleGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#mgModSummaries"><span class="hs-identifier">mgModSummaries</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#mgLookupModule"><span class="hs-identifier">mgLookupModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier">ModSummary</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier">ms_mod_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier">ModLocation</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><a href="GHC.html#getModSummary"><span class="hs-identifier">getModSummary</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><a href="GHC.html#getModuleGraph"><span class="hs-identifier">getModuleGraph</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="GHC.html#isLoaded"><span class="hs-identifier">isLoaded</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="GHC.Driver.Make.html#topSortModuleGraph"><span class="hs-identifier">topSortModuleGraph</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Inspecting modules</span></span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier">ModuleInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="GHC.html#getModuleInfo"><span class="hs-identifier">getModuleInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoTyThings"><span class="hs-identifier">modInfoTyThings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoTopLevelScope"><span class="hs-identifier">modInfoTopLevelScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoExports"><span class="hs-identifier">modInfoExports</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoExportsWithSelectors"><span class="hs-identifier">modInfoExportsWithSelectors</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoInstances"><span class="hs-identifier">modInfoInstances</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoIsExportedName"><span class="hs-identifier">modInfoIsExportedName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoLookupName"><span class="hs-identifier">modInfoLookupName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoIface"><span class="hs-identifier">modInfoIface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoRdrEnv"><span class="hs-identifier">modInfoRdrEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-84"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoSafe"><span class="hs-identifier">modInfoSafe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><a href="GHC.html#lookupGlobalName"><span class="hs-identifier">lookupGlobalName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><a href="GHC.html#findGlobalAnns"><span class="hs-identifier">findGlobalAnns</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-87"></span><span>        </span><span class="annot"><a href="GHC.html#mkPrintUnqualifiedForModule"><span class="hs-identifier">mkPrintUnqualifiedForModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-88"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#ModIface"><span class="hs-identifier">ModIface</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModIface_"><span class="hs-identifier">ModIface_</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><a href="GHC.Driver.Session.html#SafeHaskellMode"><span class="hs-identifier">SafeHaskellMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Querying the environment</span></span><span>
</span><span id="line-92"></span><span>        </span><span class="hs-comment">-- packageDbModules,</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Printing</span></span><span>
</span><span id="line-95"></span><span>        </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier">PrintUnqualified</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier">alwaysQualify</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Interactive evaluation</span></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Executing statements</span></span><span>
</span><span id="line-100"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt"><span class="hs-identifier">execStmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt%27"><span class="hs-identifier">execStmt'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier">ExecOptions</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#execOptions"><span class="hs-identifier">execOptions</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier">ExecResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-101"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#resumeExec"><span class="hs-identifier">resumeExec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Adding new declarations</span></span><span>
</span><span id="line-104"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#runDecls"><span class="hs-identifier">runDecls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#runDeclsWithLocation"><span class="hs-identifier">runDeclsWithLocation</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#runParsedDecls"><span class="hs-identifier">runParsedDecls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Get/set the current context</span></span><span>
</span><span id="line-107"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseImportDecl"><span class="hs-identifier">parseImportDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#setContext"><span class="hs-identifier">setContext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#getContext"><span class="hs-identifier">getContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-109"></span><span>        </span><span class="annot"><a href="GHC.html#setGHCiMonad"><span class="hs-identifier">setGHCiMonad</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#getGHCiMonad"><span class="hs-identifier">getGHCiMonad</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Inspecting the current context</span></span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><a href="GHC.html#getBindings"><span class="hs-identifier">getBindings</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#getInsts"><span class="hs-identifier">getInsts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#getPrintUnqual"><span class="hs-identifier">getPrintUnqual</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="GHC.html#findModule"><span class="hs-identifier">findModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#lookupModule"><span class="hs-identifier">lookupModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><a href="GHC.html#isModuleTrusted"><span class="hs-identifier">isModuleTrusted</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#moduleTrustReqs"><span class="hs-identifier">moduleTrustReqs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-115"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getNamesInScope"><span class="hs-identifier">getNamesInScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-116"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getRdrNamesInScope"><span class="hs-identifier">getRdrNamesInScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-117"></span><span>        </span><span class="annot"><a href="GHC.html#getGRE"><span class="hs-identifier">getGRE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-118"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsInterpreted"><span class="hs-identifier">moduleIsInterpreted</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getInfo"><span class="hs-identifier">getInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#showModule"><span class="hs-identifier">showModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-121"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsBootOrNotObjectLinkable"><span class="hs-identifier">moduleIsBootOrNotObjectLinkable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><a href="GHC.html#getNameToInstancesIndex"><span class="hs-identifier">getNameToInstancesIndex</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Inspecting types and kinds</span></span><span>
</span><span id="line-125"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#exprType"><span class="hs-identifier">exprType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#TcRnExprMode"><span class="hs-identifier">TcRnExprMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-126"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#typeKind"><span class="hs-identifier">typeKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Looking up a Name</span></span><span>
</span><span id="line-129"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseName"><span class="hs-identifier">parseName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-130"></span><span>        </span><span class="annot"><a href="GHC.html#lookupName"><span class="hs-identifier">lookupName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Compiling expressions</span></span><span>
</span><span id="line-133"></span><span>        </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#HValue"><span class="hs-identifier">HValue</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier">parseExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier">compileParsedExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-134"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileExpr"><span class="hs-identifier">GHC.Runtime.Eval.compileExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#dynCompileExpr"><span class="hs-identifier">dynCompileExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-135"></span><span>        </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier">ForeignHValue</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-136"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileExprRemote"><span class="hs-identifier">compileExprRemote</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier">compileParsedExprRemote</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Docs</span></span><span>
</span><span id="line-139"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getDocs"><span class="hs-identifier">getDocs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#GetDocsFailure"><span class="hs-identifier">GetDocsFailure</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Other</span></span><span>
</span><span id="line-142"></span><span>        </span><span class="annot"><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier">runTcInteractive</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- Desired by some clients (#8878)</span><span>
</span><span id="line-143"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#isStmt"><span class="hs-identifier">isStmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#hasImport"><span class="hs-identifier">hasImport</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#isImport"><span class="hs-identifier">isImport</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#isDecl"><span class="hs-identifier">isDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The debugger</span></span><span>
</span><span id="line-146"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#SingleStep"><span class="hs-identifier">SingleStep</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-147"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier">Resume</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-148"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier">History</span></a></span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#historyBreakInfo"><span class="hs-identifier">historyBreakInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#historyEnclosingDecls"><span class="hs-identifier">historyEnclosingDecls</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-149"></span><span>        </span><span class="annot"><a href="GHC.html#getHistorySpan"><span class="hs-identifier">GHC.getHistorySpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#getHistoryModule"><span class="hs-identifier">getHistoryModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-150"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#abandon"><span class="hs-identifier">abandon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#abandonAll"><span class="hs-identifier">abandonAll</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-151"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getResumeContext"><span class="hs-identifier">getResumeContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-152"></span><span>        </span><span class="annot"><a href="GHC.html#obtainTermFromId"><span class="hs-identifier">GHC.obtainTermFromId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#obtainTermFromVal"><span class="hs-identifier">GHC.obtainTermFromVal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#reconstructType"><span class="hs-identifier">reconstructType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-153"></span><span>        </span><span class="annot"><a href="GHC.html#modInfoModBreaks"><span class="hs-identifier">modInfoModBreaks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-154"></span><span>        </span><span class="annot"><a href="GHC.ByteCode.Types.html#ModBreaks"><span class="hs-identifier">ModBreaks</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#BreakIndex"><span class="hs-identifier">BreakIndex</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-155"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier">BreakInfo</span></a></span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#breakInfo_number"><span class="hs-identifier">breakInfo_number</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#breakInfo_module"><span class="hs-identifier">breakInfo_module</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-156"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#back"><span class="hs-identifier">GHC.Runtime.Eval.back</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-157"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#forward"><span class="hs-identifier">GHC.Runtime.Eval.forward</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Abstract syntax elements</span></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Units</span></span><span>
</span><span id="line-162"></span><span>        </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier">Unit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Modules</span></span><span>
</span><span id="line-165"></span><span>        </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier">Module</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#mkModule"><span class="hs-identifier">mkModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#pprModule"><span class="hs-identifier">pprModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier">moduleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier">moduleUnit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-166"></span><span>        </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#mkModuleName"><span class="hs-identifier">mkModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#moduleNameString"><span class="hs-identifier">moduleNameString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Names</span></span><span>
</span><span id="line-169"></span><span>        </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier">Name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-170"></span><span>        </span><span class="annot"><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier">isExternalName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#nameModule"><span class="hs-identifier">nameModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#pprParenSymName"><span class="hs-identifier">pprParenSymName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier">nameSrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-171"></span><span>        </span><span class="annot"><a href="GHC.Types.Name.html#NamedThing"><span class="hs-identifier">NamedThing</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-172"></span><span>        </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier">RdrName</span></a></span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#Qual"><span class="hs-identifier">Qual</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Name.Reader.html#Unqual"><span class="hs-identifier">Unqual</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Identifiers</span></span><span>
</span><span id="line-175"></span><span>        </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idType"><span class="hs-identifier">idType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-176"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#isImplicitId"><span class="hs-identifier">isImplicitId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#isDeadBinder"><span class="hs-identifier">isDeadBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-177"></span><span>        </span><span class="annot"><a href="GHC.Types.Var.html#isExportedId"><span class="hs-identifier">isExportedId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#isLocalId"><span class="hs-identifier">isLocalId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#isGlobalId"><span class="hs-identifier">isGlobalId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-178"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#isRecordSelector"><span class="hs-identifier">isRecordSelector</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-179"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#isPrimOpId"><span class="hs-identifier">isPrimOpId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#isFCallId"><span class="hs-identifier">isFCallId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#isClassOpId_maybe"><span class="hs-identifier">isClassOpId_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-180"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#isDataConWorkId"><span class="hs-identifier">isDataConWorkId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idDataCon"><span class="hs-identifier">idDataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-181"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#isDeadEndId"><span class="hs-identifier">isDeadEndId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#isDictonaryId"><span class="hs-identifier">isDictonaryId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-182"></span><span>        </span><span class="annot"><a href="GHC.Types.Id.html#recordSelectorTyCon"><span class="hs-identifier">recordSelectorTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Type constructors</span></span><span>
</span><span id="line-185"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier">TyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-186"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier">tyConTyVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier">tyConDataCons</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier">tyConArity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-187"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isClassTyCon"><span class="hs-identifier">isClassTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-identifier">isTypeSynonymTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier">isTypeFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier">isNewTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-188"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isPrimTyCon"><span class="hs-identifier">isPrimTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isFunTyCon"><span class="hs-identifier">isFunTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-189"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isFamilyTyCon"><span class="hs-identifier">isFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenFamilyTyCon"><span class="hs-identifier">isOpenFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenTypeFamilyTyCon"><span class="hs-identifier">isOpenTypeFamilyTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-190"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConClass_maybe"><span class="hs-identifier">tyConClass_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-191"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConRhs_maybe"><span class="hs-identifier">synTyConRhs_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConDefn_maybe"><span class="hs-identifier">synTyConDefn_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier">tyConKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Type variables</span></span><span>
</span><span id="line-194"></span><span>        </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier">TyVar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-195"></span><span>        </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html#alphaTyVars"><span class="hs-identifier">alphaTyVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Data constructors</span></span><span>
</span><span id="line-198"></span><span>        </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier">DataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-199"></span><span>        </span><span class="annot"><a href="GHC.html#dataConType"><span class="hs-identifier">dataConType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConTyCon"><span class="hs-identifier">dataConTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConFieldLabels"><span class="hs-identifier">dataConFieldLabels</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-200"></span><span>        </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConIsInfix"><span class="hs-identifier">dataConIsInfix</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#isVanillaDataCon"><span class="hs-identifier">isVanillaDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConWrapperType"><span class="hs-identifier">dataConWrapperType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-201"></span><span>        </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConSrcBangs"><span class="hs-identifier">dataConSrcBangs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-202"></span><span>        </span><span class="annot"><a href="GHC.Core.DataCon.html#StrictnessMark"><span class="hs-identifier">StrictnessMark</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#isMarkedStrict"><span class="hs-identifier">isMarkedStrict</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Classes</span></span><span>
</span><span id="line-205"></span><span>        </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier">Class</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-206"></span><span>        </span><span class="annot"><a href="GHC.Core.Class.html#classMethods"><span class="hs-identifier">classMethods</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#classSCTheta"><span class="hs-identifier">classSCTheta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#classTvsFds"><span class="hs-identifier">classTvsFds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#classATs"><span class="hs-identifier">classATs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-207"></span><span>        </span><span class="annot"><a href="GHC.Core.Class.html#pprFundeps"><span class="hs-identifier">pprFundeps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Instances</span></span><span>
</span><span id="line-210"></span><span>        </span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier">ClsInst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-211"></span><span>        </span><span class="annot"><a href="GHC.Core.InstEnv.html#instanceDFunId"><span class="hs-identifier">instanceDFunId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-212"></span><span>        </span><span class="annot"><a href="GHC.Core.InstEnv.html#pprInstance"><span class="hs-identifier">pprInstance</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#pprInstanceHdr"><span class="hs-identifier">pprInstanceHdr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-213"></span><span>        </span><span class="annot"><a href="GHC.Core.Ppr.TyThing.html#pprFamInst"><span class="hs-identifier">pprFamInst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span>        </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier">FamInst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Types and Kinds</span></span><span>
</span><span id="line-218"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#splitForAllTys"><span class="hs-identifier">splitForAllTys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#funResultTy"><span class="hs-identifier">funResultTy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-219"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprParendType"><span class="hs-identifier">pprParendType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprTypeApp"><span class="hs-identifier">pprTypeApp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-220"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier">Kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-221"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier">PredType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-222"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprForAll"><span class="hs-identifier">pprForAll</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprThetaArrowTy"><span class="hs-identifier">pprThetaArrowTy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-223"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseInstanceHead"><span class="hs-identifier">parseInstanceHead</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-224"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getInstancesForType"><span class="hs-identifier">getInstancesForType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Entities</span></span><span>
</span><span id="line-227"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier">TyThing</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Syntax</span></span><span>
</span><span id="line-230"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ToDo: remove extraneous bits</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Fixities</span></span><span>
</span><span id="line-233"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#FixityDirection"><span class="hs-identifier">FixityDirection</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-234"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#defaultFixity"><span class="hs-identifier">defaultFixity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#maxPrecedence"><span class="hs-identifier">maxPrecedence</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-235"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#negateFixity"><span class="hs-identifier">negateFixity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-236"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#compareFixity"><span class="hs-identifier">compareFixity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-237"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#LexicalFixity"><span class="hs-identifier">LexicalFixity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Source locations</span></span><span>
</span><span id="line-240"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcLoc"><span class="hs-identifier">SrcLoc</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcLoc"><span class="hs-identifier">RealSrcLoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-241"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#mkSrcLoc"><span class="hs-identifier">mkSrcLoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#noSrcLoc"><span class="hs-identifier">noSrcLoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-242"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcLocFile"><span class="hs-identifier">srcLocFile</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcLocLine"><span class="hs-identifier">srcLocLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcLocCol"><span class="hs-identifier">srcLocCol</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-243"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier">SrcSpan</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier">RealSrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-244"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#mkSrcSpan"><span class="hs-identifier">mkSrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcLocSpan"><span class="hs-identifier">srcLocSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#isGoodSrcSpan"><span class="hs-identifier">isGoodSrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier">noSrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-245"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanStart"><span class="hs-identifier">srcSpanStart</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanEnd"><span class="hs-identifier">srcSpanEnd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-246"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanFile"><span class="hs-identifier">srcSpanFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-247"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanStartLine"><span class="hs-identifier">srcSpanStartLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanEndLine"><span class="hs-identifier">srcSpanEndLine</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-248"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanStartCol"><span class="hs-identifier">srcSpanStartCol</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#srcSpanEndCol"><span class="hs-identifier">srcSpanEndCol</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Located</span></span><span>
</span><span id="line-251"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#GenLocated"><span class="hs-identifier">GenLocated</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier">Located</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealLocated"><span class="hs-identifier">RealLocated</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>        </span><span class="annot"><span class="hs-comment">-- *** Constructing Located</span></span><span>
</span><span id="line-254"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier">noLoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#mkGeneralLocated"><span class="hs-identifier">mkGeneralLocated</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span>        </span><span class="annot"><span class="hs-comment">-- *** Deconstructing Located</span></span><span>
</span><span id="line-257"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier">getLoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier">unLoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-258"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#getRealSrcSpan"><span class="hs-identifier">getRealSrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#unRealSrcSpan"><span class="hs-identifier">unRealSrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span>        </span><span class="annot"><span class="hs-comment">-- *** Combining and comparing Located values</span></span><span>
</span><span id="line-261"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#eqLocated"><span class="hs-identifier">eqLocated</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#cmpLocated"><span class="hs-identifier">cmpLocated</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#combineLocs"><span class="hs-identifier">combineLocs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#addCLoc"><span class="hs-identifier">addCLoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-262"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier">leftmost_smallest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#leftmost_largest"><span class="hs-identifier">leftmost_largest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#rightmost_smallest"><span class="hs-identifier">rightmost_smallest</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-263"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#spans"><span class="hs-identifier">spans</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#isSubspanOf"><span class="hs-identifier">isSubspanOf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Exceptions</span></span><span>
</span><span id="line-266"></span><span>        </span><span class="annot"><a href="GHC.Utils.Panic.html#GhcException"><span class="hs-identifier">GhcException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html#showGhcException"><span class="hs-identifier">showGhcException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Token stream manipulations</span></span><span>
</span><span id="line-269"></span><span>        </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier">Token</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-270"></span><span>        </span><span class="annot"><a href="GHC.html#getTokenStream"><span class="hs-identifier">getTokenStream</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#getRichTokenStream"><span class="hs-identifier">getRichTokenStream</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-271"></span><span>        </span><span class="annot"><a href="GHC.html#showRichTokenStream"><span class="hs-identifier">showRichTokenStream</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.html#addSourceToTokens"><span class="hs-identifier">addSourceToTokens</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Pure interface to the parser</span></span><span>
</span><span id="line-274"></span><span>        </span><span class="annot"><a href="GHC.html#parser"><span class="hs-identifier">parser</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span>        </span><span class="annot"><span class="hs-comment">-- * API Annotations</span></span><span>
</span><span id="line-277"></span><span>        </span><span class="annot"><a href="GHC.Parser.Annotation.html#ApiAnns"><span class="hs-identifier">ApiAnns</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><a href="GHC.Parser.Annotation.html#AnnKeywordId"><span class="hs-identifier">AnnKeywordId</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><a href="GHC.Parser.Annotation.html#AnnotationComment"><span class="hs-identifier">AnnotationComment</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html#ApiAnnKey"><span class="hs-identifier">ApiAnnKey</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-278"></span><span>        </span><span class="annot"><a href="GHC.Parser.Annotation.html#getAnnotation"><span class="hs-identifier">getAnnotation</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html#getAndRemoveAnnotation"><span class="hs-identifier">getAndRemoveAnnotation</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-279"></span><span>        </span><span class="annot"><a href="GHC.Parser.Annotation.html#getAnnotationComments"><span class="hs-identifier">getAnnotationComments</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html#getAndRemoveAnnotationComments"><span class="hs-identifier">getAndRemoveAnnotationComments</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-280"></span><span>        </span><span class="annot"><a href="GHC.Parser.Annotation.html#unicodeAnn"><span class="hs-identifier">unicodeAnn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Miscellaneous</span></span><span>
</span><span id="line-283"></span><span>        </span><span class="hs-comment">--sessionHscEnv,</span><span>
</span><span id="line-284"></span><span>        </span><span class="annot"><a href="GHC.Driver.Make.html#cyclicModuleErr"><span class="hs-identifier">cyclicModuleErr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="hs-comment">{-
 ToDo:

  * inline bits of GHC.Driver.Main here to simplify layering: hscTcExpr, hscStmt.
-}</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-295"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.List.html#init"><span class="hs-identifier">init</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html"><span class="hs-identifier">GHC.ByteCode.Types</span></a></span><span>
</span><span id="line-298"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html"><span class="hs-identifier">GHC.Runtime.Eval</span></a></span><span>
</span><span id="line-299"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html"><span class="hs-identifier">GHC.Runtime.Eval.Types</span></a></span><span>
</span><span id="line-300"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span>
</span><span id="line-301"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.Types.html"><span class="hs-identifier">GHC.Runtime.Interpreter.Types</span></a></span><span>
</span><span id="line-302"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.TyThing.html"><span class="hs-identifier">GHC.Core.Ppr.TyThing</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.TyThing.html#pprFamInst"><span class="hs-identifier">pprFamInst</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Main.html"><span class="hs-identifier">GHC.Driver.Main</span></a></span><span>
</span><span id="line-306"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Make.html"><span class="hs-identifier">GHC.Driver.Make</span></a></span><span>
</span><span id="line-307"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Hooks.html"><span class="hs-identifier">GHC.Driver.Hooks</span></a></span><span>
</span><span id="line-308"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Pipeline.html"><span class="hs-identifier">GHC.Driver.Pipeline</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Pipeline.html#compileOne%27"><span class="hs-identifier">compileOne'</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html"><span class="hs-identifier">GHC.Driver.Monad</span></a></span><span>
</span><span id="line-310"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#finalSafeMode"><span class="hs-identifier">finalSafeMode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#fixSafeInstances"><span class="hs-identifier">fixSafeInstances</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#initIfaceTcRn"><span class="hs-identifier">initIfaceTcRn</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Load.html"><span class="hs-identifier">GHC.Iface.Load</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Load.html#loadSysInterface"><span class="hs-identifier">loadSysInterface</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html"><span class="hs-identifier">GHC.Tc.Types</span></a></span><span>
</span><span id="line-313"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html"><span class="hs-identifier">GHC.Core.Predicate</span></a></span><span>
</span><span id="line-314"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.State.html"><span class="hs-identifier">GHC.Unit.State</span></a></span><span>
</span><span id="line-315"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-316"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-317"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-318"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>  </span><span class="hs-keyword">hiding</span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier">typeKind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-320"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-321"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html#alphaTyVars"><span class="hs-identifier">alphaTyVars</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-322"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-323"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html"><span class="hs-identifier">GHC.Core.TyCo.Ppr</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprForAll"><span class="hs-identifier">pprForAll</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span>
</span><span id="line-325"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-326"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html#orphNamesOfFamInst"><span class="hs-identifier">orphNamesOfFamInst</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier">FamInst</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#famInstEnvElts"><span class="hs-identifier">famInstEnvElts</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html"><span class="hs-identifier">GHC.Core.InstEnv</span></a></span><span>
</span><span id="line-329"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>      </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier">varName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html"><span class="hs-identifier">GHC.Types.Avail</span></a></span><span>
</span><span id="line-331"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-332"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-333"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Tidy.html"><span class="hs-identifier">GHC.Iface.Tidy</span></a></span><span>
</span><span id="line-334"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html"><span class="hs-identifier">GHC.Driver.Phases</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#Phase"><span class="hs-identifier">Phase</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#isHaskellSrcFilename"><span class="hs-identifier">isHaskellSrcFilename</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html"><span class="hs-identifier">GHC.Driver.Finder</span></a></span><span>
</span><span id="line-336"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-337"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.CmdLine.html"><span class="hs-identifier">GHC.Driver.CmdLine</span></a></span><span>
</span><span id="line-338"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Flags.html#WarnReason"><span class="hs-identifier">WarnReason</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-339"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Ways.html"><span class="hs-identifier">GHC.Driver.Ways</span></a></span><span>
</span><span id="line-340"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.html"><span class="hs-identifier">GHC.SysTools</span></a></span><span>
</span><span id="line-341"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.BaseDir.html"><span class="hs-identifier">GHC.SysTools.BaseDir</span></a></span><span>
</span><span id="line-342"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Annotations.html"><span class="hs-identifier">GHC.Types.Annotations</span></a></span><span>
</span><span id="line-343"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-344"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-345"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-346"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#listToBag"><span class="hs-identifier">listToBag</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-348"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>
</span><span id="line-349"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-350"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html"><span class="hs-identifier">GHC.Data.StringBuffer</span></a></span><span>
</span><span id="line-351"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-352"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-353"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-354"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Parser.html"><span class="hs-identifier">GHC.Parser</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Parser</span></span><span>
</span><span id="line-355"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html"><span class="hs-identifier">GHC.Parser.Lexer</span></a></span><span>
</span><span id="line-356"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html"><span class="hs-identifier">GHC.Parser.Annotation</span></a></span><span>
</span><span id="line-357"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-358"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-359"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html"><span class="hs-identifier">GHC.Tc.Module</span></a></span><span>
</span><span id="line-360"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html"><span class="hs-identifier">GHC.Tc.Utils.Instantiate</span></a></span><span>
</span><span id="line-361"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Instance.Family.html"><span class="hs-identifier">GHC.Tc.Instance.Family</span></a></span><span>
</span><span id="line-362"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.FileCleanup.html"><span class="hs-identifier">GHC.SysTools.FileCleanup</span></a></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span>
</span><span id="line-365"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Strict.html#"><span class="hs-identifier">Data.Map.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-366"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier">Set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-368"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Sequence.html#"><span class="hs-identifier">Data.Sequence</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Seq</span></span><span>
</span><span id="line-369"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-370"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.html#"><span class="hs-identifier">Data.Time</span></a></span><span>
</span><span id="line-371"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.html#"><span class="hs-identifier">Data.Typeable</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier">Word8</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-374"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#"><span class="hs-identifier">System.Exit</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier">exitWith</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier">ExitCode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html"><span class="hs-identifier">GHC.Utils.Exception</span></a></span><span>
</span><span id="line-376"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-377"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-378"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Concurrent.html#"><span class="hs-identifier">Control.Concurrent</span></a></span><span>
</span><span id="line-379"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator">(&lt;|&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#"><span class="hs-identifier">Control.Monad.Catch</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">MC</span></span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-383"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#isDoesNotExistError"><span class="hs-identifier">isDoesNotExistError</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-384"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Environment.html#"><span class="hs-identifier">System.Environment</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.Environment.html#getEnv"><span class="hs-identifier">getEnv</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-389"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-390"></span><span class="hs-comment">--             Initialisation: exception handlers</span><span>
</span><span id="line-391"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span class="hs-comment">-- | Install some default exception handlers and run the inner computation.</span><span>
</span><span id="line-396"></span><span class="hs-comment">-- Unless you want to handle exceptions yourself, you should wrap this around</span><span>
</span><span id="line-397"></span><span class="hs-comment">-- the top level of your program.  The default handlers output the error</span><span>
</span><span id="line-398"></span><span class="hs-comment">-- message(s) to stderr and exit cleanly.</span><span>
</span><span id="line-399"></span><span id="local-6989586621681209947"><span id="local-6989586621681209951"><span class="annot"><a href="GHC.html#defaultErrorHandler"><span class="hs-identifier hs-type">defaultErrorHandler</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Exception.html#ExceptionMonad"><span class="hs-identifier hs-type">ExceptionMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209951"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>                    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#FatalMessager"><span class="hs-identifier hs-type">FatalMessager</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#FlushOut"><span class="hs-identifier hs-type">FlushOut</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209951"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209947"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209951"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209947"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-401"></span><span id="defaultErrorHandler"><span class="annot"><span class="annottext">defaultErrorHandler :: forall (m :: * -&gt; *) a.
ExceptionMonad m =&gt;
FatalMessager -&gt; FlushOut -&gt; m a -&gt; m a
</span><a href="GHC.html#defaultErrorHandler"><span class="hs-identifier hs-var hs-var">defaultErrorHandler</span></a></span></span><span> </span><span id="local-6989586621681209087"><span class="annot"><span class="annottext">FatalMessager
</span><a href="#local-6989586621681209087"><span class="hs-identifier hs-var">fm</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#FlushOut"><span class="hs-identifier hs-type">FlushOut</span></a></span><span> </span><span id="local-6989586621681209085"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681209085"><span class="hs-identifier hs-var">flushOut</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681209084"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681209084"><span class="hs-identifier hs-var">inner</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-402"></span><span>  </span><span class="hs-comment">-- top-level exception handler: any unrecognised exception is a compiler bug.</span><span>
</span><span id="line-403"></span><span>  </span><span class="annot"><span class="annottext">(SomeException -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var">MC.handle</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681209082"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209082"><span class="hs-identifier hs-var">exception</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; m a) -&gt; IO a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-404"></span><span>           </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681209085"><span class="hs-identifier hs-var">flushOut</span></a></span><span>
</span><span id="line-405"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe IOError
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">fromException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209082"><span class="hs-identifier hs-var">exception</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-406"></span><span>                </span><span class="hs-comment">-- an IO exception probably isn't our fault, so don't panic</span><span>
</span><span id="line-407"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681209079"><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621681209079"><span class="hs-identifier hs-var">ioe</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-408"></span><span>                  </span><span class="annot"><span class="annottext">FatalMessager -&gt; FatalMessager
</span><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-var">fatalErrorMsg''</span></a></span><span> </span><span class="annot"><span class="annottext">FatalMessager
</span><a href="#local-6989586621681209087"><span class="hs-identifier hs-var">fm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621681209079"><span class="hs-identifier hs-var">ioe</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>                </span><span class="annot"><span class="annottext">Maybe IOError
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe AsyncException
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">fromException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209082"><span class="hs-identifier hs-var">exception</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-410"></span><span>                     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException
</span><a href="../../base/src/GHC.IO.Exception.html#UserInterrupt"><span class="hs-identifier hs-var">UserInterrupt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-411"></span><span>                         </span><span class="hs-comment">-- Important to let this one propagate out so our</span><span>
</span><span id="line-412"></span><span>                         </span><span class="hs-comment">-- calling process knows we were interrupted by ^C</span><span>
</span><span id="line-413"></span><span>                         </span><span class="annot"><span class="annottext">IO () -&gt; IO ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException
</span><a href="../../base/src/GHC.IO.Exception.html#UserInterrupt"><span class="hs-identifier hs-var">UserInterrupt</span></a></span><span>
</span><span id="line-414"></span><span>                     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException
</span><a href="../../base/src/GHC.IO.Exception.html#StackOverflow"><span class="hs-identifier hs-var">StackOverflow</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-415"></span><span>                         </span><span class="annot"><span class="annottext">FatalMessager -&gt; FatalMessager
</span><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-var">fatalErrorMsg''</span></a></span><span> </span><span class="annot"><span class="annottext">FatalMessager
</span><a href="#local-6989586621681209087"><span class="hs-identifier hs-var">fm</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;stack overflow: use +RTS -K&lt;size&gt; to increase it&quot;</span></span><span>
</span><span id="line-416"></span><span>                     </span><span class="annot"><span class="annottext">Maybe AsyncException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe ExitCode
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">fromException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209082"><span class="hs-identifier hs-var">exception</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-417"></span><span>                          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681209072"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621681209072"><span class="hs-identifier hs-var">ex</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621681209072"><span class="hs-identifier hs-var">ex</span></a></span><span>
</span><span id="line-418"></span><span>                          </span><span class="annot"><span class="annottext">Maybe ExitCode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-419"></span><span>                              </span><span class="annot"><span class="annottext">FatalMessager -&gt; FatalMessager
</span><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-var">fatalErrorMsg''</span></a></span><span> </span><span class="annot"><span class="annottext">FatalMessager
</span><a href="#local-6989586621681209087"><span class="hs-identifier hs-var">fm</span></a></span><span>
</span><span id="line-420"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GhcException -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#Panic"><span class="hs-identifier hs-var">Panic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209082"><span class="hs-identifier hs-var">exception</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>           </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>         </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; m a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-comment">-- error messages propagated as exceptions</span><span>
</span><span id="line-425"></span><span>  </span><span class="annot"><span class="annottext">(GhcException -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a.
ExceptionMonad m =&gt;
(GhcException -&gt; m a) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Panic.html#handleGhcException"><span class="hs-identifier hs-var">handleGhcException</span></a></span><span>
</span><span id="line-426"></span><span>            </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681209068"><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621681209068"><span class="hs-identifier hs-var">ge</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; m a) -&gt; IO a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-427"></span><span>                </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681209085"><span class="hs-identifier hs-var">flushOut</span></a></span><span>
</span><span id="line-428"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621681209068"><span class="hs-identifier hs-var">ge</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-429"></span><span>                     </span><span class="annot"><a href="GHC.Utils.Panic.html#Signal"><span class="hs-identifier hs-type">Signal</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>                     </span><span class="annot"><span class="annottext">GhcException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">FatalMessager -&gt; FatalMessager
</span><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-var">fatalErrorMsg''</span></a></span><span> </span><span class="annot"><span class="annottext">FatalMessager
</span><a href="#local-6989586621681209087"><span class="hs-identifier hs-var">fm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GhcException -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621681209068"><span class="hs-identifier hs-var">ge</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span>                             </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>            </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; m a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-433"></span><span>  </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681209084"><span class="hs-identifier hs-var">inner</span></a></span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span class="hs-comment">-- | This function is no longer necessary, cleanup is now done by</span><span>
</span><span id="line-436"></span><span class="hs-comment">-- runGhc/runGhcT.</span><span>
</span><span id="line-437"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">defaultCleanupHandler</span><span> </span><span class="hs-pragma">&quot;Cleanup is now done by runGhc/runGhcT&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-438"></span><span id="local-6989586621681209918"><span id="local-6989586621681209920"><span class="annot"><a href="GHC.html#defaultCleanupHandler"><span class="hs-identifier hs-type">defaultCleanupHandler</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Exception.html#ExceptionMonad"><span class="hs-identifier hs-type">ExceptionMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209920"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209920"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209918"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209920"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209918"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-439"></span><span id="defaultCleanupHandler"><span class="annot"><span class="annottext">defaultCleanupHandler :: forall (m :: * -&gt; *) a. ExceptionMonad m =&gt; DynFlags -&gt; m a -&gt; m a
</span><a href="GHC.html#defaultCleanupHandler"><span class="hs-identifier hs-var hs-var">defaultCleanupHandler</span></a></span></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681209061"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681209061"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681209061"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-440"></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681209060"><span class="annot"><span class="annottext">_warning_suppression :: m a
</span><a href="#local-6989586621681209060"><span class="hs-identifier hs-var hs-var">_warning_suppression</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681209061"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m Any -&gt; m a
forall (m :: * -&gt; *) a b. MonadCatch m =&gt; m a -&gt; m b -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#onException"><span class="hs-operator hs-var">`MC.onException`</span></a></span><span> </span><span class="annot"><span class="annottext">m Any
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-444"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-445"></span><span class="hs-comment">--             The Ghc Monad</span><span>
</span><span id="line-446"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-447"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-448"></span><span>
</span><span id="line-449"></span><span class="hs-comment">-- | Run function for the 'Ghc' monad.</span><span>
</span><span id="line-450"></span><span class="hs-comment">--</span><span>
</span><span id="line-451"></span><span class="hs-comment">-- It initialises the GHC session and warnings via 'initGhcMonad'.  Each call</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- to this function will create a new session which should not be shared among</span><span>
</span><span id="line-453"></span><span class="hs-comment">-- several threads.</span><span>
</span><span id="line-454"></span><span class="hs-comment">--</span><span>
</span><span id="line-455"></span><span class="hs-comment">-- Any errors not handled inside the 'Ghc' action are propagated as IO</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- exceptions.</span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span id="local-6989586621681209910"><span class="annot"><a href="GHC.html#runGhc"><span class="hs-identifier hs-type">runGhc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>  </span><span class="hs-comment">-- ^ See argument to 'initGhcMonad'.</span><span>
</span><span id="line-459"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#Ghc"><span class="hs-identifier hs-type">Ghc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209910"><span class="hs-identifier hs-type">a</span></a></span><span>           </span><span class="hs-comment">-- ^ The action to perform.</span><span>
</span><span id="line-460"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681209910"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-461"></span><span id="runGhc"><span class="annot"><span class="annottext">runGhc :: forall a. Maybe FilePath -&gt; Ghc a -&gt; IO a
</span><a href="GHC.html#runGhc"><span class="hs-identifier hs-var hs-var">runGhc</span></a></span></span><span> </span><span id="local-6989586621681209042"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681209042"><span class="hs-identifier hs-var">mb_top_dir</span></a></span></span><span> </span><span id="local-6989586621681209041"><span class="annot"><span class="annottext">Ghc a
</span><a href="#local-6989586621681209041"><span class="hs-identifier hs-var">ghc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-462"></span><span>  </span><span id="local-6989586621681209040"><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681209040"><span class="hs-identifier hs-var">ref</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO (IORef HscEnv)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; HscEnv
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;empty session&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681209037"><span class="annot"><span class="annottext">session :: Session
</span><a href="#local-6989586621681209037"><span class="hs-identifier hs-var hs-var">session</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef HscEnv -&gt; Session
</span><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-var">Session</span></a></span><span> </span><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681209040"><span class="hs-identifier hs-var">ref</span></a></span><span>
</span><span id="line-464"></span><span>  </span><span class="annot"><span class="annottext">(Ghc a -&gt; Session -&gt; IO a) -&gt; Session -&gt; Ghc a -&gt; IO a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Ghc a -&gt; Session -&gt; IO a
forall a. Ghc a -&gt; Session -&gt; IO a
</span><a href="GHC.Driver.Monad.html#unGhc"><span class="hs-identifier hs-var hs-var">unGhc</span></a></span><span> </span><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681209037"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="annot"><span class="annottext">(Ghc a -&gt; IO a) -&gt; Ghc a -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Ghc a -&gt; Ghc a
forall (m :: * -&gt; *) a. ExceptionMonad m =&gt; m a -&gt; m a
</span><a href="GHC.Utils.Panic.html#withSignalHandlers"><span class="hs-identifier hs-var">withSignalHandlers</span></a></span><span> </span><span class="annot"><span class="annottext">(Ghc a -&gt; Ghc a) -&gt; Ghc a -&gt; Ghc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- catch ^C</span><span>
</span><span id="line-465"></span><span>    </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; Ghc ()
forall (m :: * -&gt; *). GhcMonad m =&gt; Maybe FilePath -&gt; m ()
</span><a href="GHC.html#initGhcMonad"><span class="hs-identifier hs-var">initGhcMonad</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681209042"><span class="hs-identifier hs-var">mb_top_dir</span></a></span><span>
</span><span id="line-466"></span><span>    </span><span class="annot"><span class="annottext">Ghc a -&gt; Ghc a
forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.html#withCleanupSession"><span class="hs-identifier hs-var">withCleanupSession</span></a></span><span> </span><span class="annot"><span class="annottext">Ghc a
</span><a href="#local-6989586621681209041"><span class="hs-identifier hs-var">ghc</span></a></span><span>
</span><span id="line-467"></span><span>
</span><span id="line-468"></span><span class="hs-comment">-- | Run function for 'GhcT' monad transformer.</span><span>
</span><span id="line-469"></span><span class="hs-comment">--</span><span>
</span><span id="line-470"></span><span class="hs-comment">-- It initialises the GHC session and warnings via 'initGhcMonad'.  Each call</span><span>
</span><span id="line-471"></span><span class="hs-comment">-- to this function will create a new session which should not be shared among</span><span>
</span><span id="line-472"></span><span class="hs-comment">-- several threads.</span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span id="local-6989586621681209889"><span id="local-6989586621681209890"><span class="annot"><a href="GHC.html#runGhcT"><span class="hs-identifier hs-type">runGhcT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html#ExceptionMonad"><span class="hs-identifier hs-type">ExceptionMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209890"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-475"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>  </span><span class="hs-comment">-- ^ See argument to 'initGhcMonad'.</span><span>
</span><span id="line-476"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcT"><span class="hs-identifier hs-type">GhcT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209890"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209889"><span class="hs-identifier hs-type">a</span></a></span><span>        </span><span class="hs-comment">-- ^ The action to perform.</span><span>
</span><span id="line-477"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209890"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209889"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-478"></span><span id="runGhcT"><span class="annot"><span class="annottext">runGhcT :: forall (m :: * -&gt; *) a.
ExceptionMonad m =&gt;
Maybe FilePath -&gt; GhcT m a -&gt; m a
</span><a href="GHC.html#runGhcT"><span class="hs-identifier hs-var hs-var">runGhcT</span></a></span></span><span> </span><span id="local-6989586621681209008"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681209008"><span class="hs-identifier hs-var">mb_top_dir</span></a></span></span><span> </span><span id="local-6989586621681209007"><span class="annot"><span class="annottext">GhcT m a
</span><a href="#local-6989586621681209007"><span class="hs-identifier hs-var">ghct</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-479"></span><span>  </span><span id="local-6989586621681209006"><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681209006"><span class="hs-identifier hs-var">ref</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (IORef HscEnv) -&gt; m (IORef HscEnv)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (IORef HscEnv) -&gt; m (IORef HscEnv))
-&gt; IO (IORef HscEnv) -&gt; m (IORef HscEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO (IORef HscEnv)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; HscEnv
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;empty session&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-480"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681209005"><span class="annot"><span class="annottext">session :: Session
</span><a href="#local-6989586621681209005"><span class="hs-identifier hs-var hs-var">session</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef HscEnv -&gt; Session
</span><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-var">Session</span></a></span><span> </span><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681209006"><span class="hs-identifier hs-var">ref</span></a></span><span>
</span><span id="line-481"></span><span>  </span><span class="annot"><span class="annottext">(GhcT m a -&gt; Session -&gt; m a) -&gt; Session -&gt; GhcT m a -&gt; m a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">GhcT m a -&gt; Session -&gt; m a
forall (m :: * -&gt; *) a. GhcT m a -&gt; Session -&gt; m a
</span><a href="GHC.Driver.Monad.html#unGhcT"><span class="hs-identifier hs-var hs-var">unGhcT</span></a></span><span> </span><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681209005"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcT m a -&gt; m a) -&gt; GhcT m a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcT m a -&gt; GhcT m a
forall (m :: * -&gt; *) a. ExceptionMonad m =&gt; m a -&gt; m a
</span><a href="GHC.Utils.Panic.html#withSignalHandlers"><span class="hs-identifier hs-var">withSignalHandlers</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcT m a -&gt; GhcT m a) -&gt; GhcT m a -&gt; GhcT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- catch ^C</span><span>
</span><span id="line-482"></span><span>    </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; GhcT m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; Maybe FilePath -&gt; m ()
</span><a href="GHC.html#initGhcMonad"><span class="hs-identifier hs-var">initGhcMonad</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681209008"><span class="hs-identifier hs-var">mb_top_dir</span></a></span><span>
</span><span id="line-483"></span><span>    </span><span class="annot"><span class="annottext">GhcT m a -&gt; GhcT m a
forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.html#withCleanupSession"><span class="hs-identifier hs-var">withCleanupSession</span></a></span><span> </span><span class="annot"><span class="annottext">GhcT m a
</span><a href="#local-6989586621681209007"><span class="hs-identifier hs-var">ghct</span></a></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span id="local-6989586621681209891"><span id="local-6989586621681209892"><span class="annot"><a href="GHC.html#withCleanupSession"><span class="hs-identifier hs-type">withCleanupSession</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209892"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209892"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209891"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209892"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209891"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-486"></span><span id="withCleanupSession"><span class="annot"><span class="annottext">withCleanupSession :: forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.html#withCleanupSession"><span class="hs-identifier hs-var hs-var">withCleanupSession</span></a></span></span><span> </span><span id="local-6989586621681208994"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681208994"><span class="hs-identifier hs-var">ghc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681208994"><span class="hs-identifier hs-var">ghc</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m () -&gt; m a
forall (m :: * -&gt; *) a b. MonadMask m =&gt; m a -&gt; m b -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#finally"><span class="hs-operator hs-var">`MC.finally`</span></a></span><span> </span><span class="annot"><span class="annottext">m ()
</span><a href="#local-6989586621681208992"><span class="hs-identifier hs-var">cleanup</span></a></span><span>
</span><span id="line-487"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-488"></span><span>   </span><span id="local-6989586621681208992"><span class="annot"><span class="annottext">cleanup :: m ()
</span><a href="#local-6989586621681208992"><span class="hs-identifier hs-var hs-var">cleanup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-489"></span><span>      </span><span id="local-6989586621681208986"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208986"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-490"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208984"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681208984"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208986"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-491"></span><span>      </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-492"></span><span>          </span><span class="annot"><span class="annottext">DynFlags -&gt; IO ()
</span><a href="GHC.SysTools.FileCleanup.html#cleanTempFiles"><span class="hs-identifier hs-var">cleanTempFiles</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208984"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-493"></span><span>          </span><span class="annot"><span class="annottext">DynFlags -&gt; IO ()
</span><a href="GHC.SysTools.FileCleanup.html#cleanTempDirs"><span class="hs-identifier hs-var">cleanTempDirs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208984"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-494"></span><span>          </span><span class="annot"><span class="annottext">HscEnv -&gt; IO ()
</span><a href="GHC.Runtime.Interpreter.html#stopInterp"><span class="hs-identifier hs-var">stopInterp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208986"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-comment">-- shut down the IServ</span><span>
</span><span id="line-495"></span><span>          </span><span class="hs-comment">--  exceptions will be blocked while we clean the temporary files,</span><span>
</span><span id="line-496"></span><span>          </span><span class="hs-comment">-- so there shouldn't be any difficulty if we receive further</span><span>
</span><span id="line-497"></span><span>          </span><span class="hs-comment">-- signals.</span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span class="hs-comment">-- | Initialise a GHC session.</span><span>
</span><span id="line-500"></span><span class="hs-comment">--</span><span>
</span><span id="line-501"></span><span class="hs-comment">-- If you implement a custom 'GhcMonad' you must call this function in the</span><span>
</span><span id="line-502"></span><span class="hs-comment">-- monad run function.  It will initialise the session variable and clear all</span><span>
</span><span id="line-503"></span><span class="hs-comment">-- warnings.</span><span>
</span><span id="line-504"></span><span class="hs-comment">--</span><span>
</span><span id="line-505"></span><span class="hs-comment">-- The first argument should point to the directory where GHC's library files</span><span>
</span><span id="line-506"></span><span class="hs-comment">-- reside.  More precisely, this should be the output of @ghc --print-libdir@</span><span>
</span><span id="line-507"></span><span class="hs-comment">-- of the version of GHC the module using this API is compiled with.  For</span><span>
</span><span id="line-508"></span><span class="hs-comment">-- portability, you should use the @ghc-paths@ package, available at</span><span>
</span><span id="line-509"></span><span class="hs-comment">-- &lt;http://hackage.haskell.org/package/ghc-paths&gt;.</span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span id="local-6989586621681209893"><span class="annot"><a href="GHC.html#initGhcMonad"><span class="hs-identifier hs-type">initGhcMonad</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209893"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209893"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-512"></span><span id="initGhcMonad"><span class="annot"><span class="annottext">initGhcMonad :: forall (m :: * -&gt; *). GhcMonad m =&gt; Maybe FilePath -&gt; m ()
</span><a href="GHC.html#initGhcMonad"><span class="hs-identifier hs-var hs-var">initGhcMonad</span></a></span></span><span> </span><span id="local-6989586621681208963"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681208963"><span class="hs-identifier hs-var">mb_top_dir</span></a></span></span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681208962"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208962"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO HscEnv -&gt; m HscEnv
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HscEnv -&gt; m HscEnv) -&gt; IO HscEnv -&gt; m HscEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-514"></span><span>                </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681208961"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208961"><span class="hs-identifier hs-var">top_dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO FilePath
</span><a href="GHC.SysTools.BaseDir.html#findTopDir"><span class="hs-identifier hs-var">findTopDir</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681208963"><span class="hs-identifier hs-var">mb_top_dir</span></a></span><span>
</span><span id="line-515"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681208959"><span class="annot"><span class="annottext">Settings
</span><a href="#local-6989586621681208959"><span class="hs-identifier hs-var">mySettings</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO Settings
</span><a href="GHC.SysTools.html#initSysTools"><span class="hs-identifier hs-var">initSysTools</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208961"><span class="hs-identifier hs-var">top_dir</span></a></span><span>
</span><span id="line-516"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681208957"><span class="annot"><span class="annottext">LlvmConfig
</span><a href="#local-6989586621681208957"><span class="hs-identifier hs-var">myLlvmConfig</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO LlvmConfig
</span><a href="GHC.SysTools.html#lazyInitLlvmConfig"><span class="hs-identifier hs-var">lazyInitLlvmConfig</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208961"><span class="hs-identifier hs-var">top_dir</span></a></span><span>
</span><span id="line-517"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681208955"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208955"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
</span><a href="GHC.Driver.Session.html#initDynFlags"><span class="hs-identifier hs-var">initDynFlags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Settings -&gt; LlvmConfig -&gt; DynFlags
</span><a href="GHC.Driver.Session.html#defaultDynFlags"><span class="hs-identifier hs-var">defaultDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">Settings
</span><a href="#local-6989586621681208959"><span class="hs-identifier hs-var">mySettings</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmConfig
</span><a href="#local-6989586621681208957"><span class="hs-identifier hs-var">myLlvmConfig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-518"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO ()
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#checkBrokenTablesNextToCode"><span class="hs-identifier hs-var">checkBrokenTablesNextToCode</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208955"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-519"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO ()
</span><a href="GHC.Driver.Session.html#setUnsafeGlobalDynFlags"><span class="hs-identifier hs-var">setUnsafeGlobalDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208955"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-520"></span><span>                      </span><span class="hs-comment">-- c.f. DynFlags.parseDynamicFlagsFull, which</span><span>
</span><span id="line-521"></span><span>                      </span><span class="hs-comment">-- creates DynFlags and sets the UnsafeGlobalDynFlags</span><span>
</span><span id="line-522"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO HscEnv
</span><a href="GHC.Driver.Main.html#newHscEnv"><span class="hs-identifier hs-var">newHscEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208955"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-523"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208962"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-524"></span><span>
</span><span id="line-525"></span><span class="hs-comment">-- | The binutils linker on ARM emits unnecessary R_ARM_COPY relocations which</span><span>
</span><span id="line-526"></span><span class="hs-comment">-- breaks tables-next-to-code in dynamically linked modules. This</span><span>
</span><span id="line-527"></span><span class="hs-comment">-- check should be more selective but there is currently no released</span><span>
</span><span id="line-528"></span><span class="hs-comment">-- version where this bug is fixed.</span><span>
</span><span id="line-529"></span><span class="hs-comment">-- See https://sourceware.org/bugzilla/show_bug.cgi?id=16177 and</span><span>
</span><span id="line-530"></span><span class="hs-comment">-- https://gitlab.haskell.org/ghc/ghc/issues/4210#note_78333</span><span>
</span><span id="line-531"></span><span id="local-6989586621681209866"><span class="annot"><a href="GHC.html#checkBrokenTablesNextToCode"><span class="hs-identifier hs-type">checkBrokenTablesNextToCode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209866"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209866"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-532"></span><span id="checkBrokenTablesNextToCode"><span class="annot"><span class="annottext">checkBrokenTablesNextToCode :: forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#checkBrokenTablesNextToCode"><span class="hs-identifier hs-var hs-var">checkBrokenTablesNextToCode</span></a></span></span><span> </span><span id="local-6989586621681208933"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208933"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-533"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681208932"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208932"><span class="hs-identifier hs-var">broken</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m Bool
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#checkBrokenTablesNextToCode%27"><span class="hs-identifier hs-var">checkBrokenTablesNextToCode'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208933"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-534"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208932"><span class="hs-identifier hs-var">broken</span></a></span><span>
</span><span id="line-535"></span><span>         </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Any
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Any -&gt; m Any
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Any -&gt; m Any) -&gt; IO Any -&gt; m Any
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcApiError -&gt; IO Any
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcApiError -&gt; IO Any) -&gt; GhcApiError -&gt; IO Any
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; GhcApiError
</span><a href="GHC.Driver.Types.html#mkApiErr"><span class="hs-identifier hs-var">mkApiErr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208933"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681208928"><span class="hs-identifier hs-var">invalidLdErr</span></a></span><span>
</span><span id="line-536"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FatalMessager
forall (m :: * -&gt; *) a. MonadFail m =&gt; FilePath -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;unsupported linker&quot;</span></span><span>
</span><span id="line-537"></span><span>              </span><span class="hs-special">}</span><span>
</span><span id="line-538"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-539"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-540"></span><span>    </span><span id="local-6989586621681208928"><span class="annot"><span class="annottext">invalidLdErr :: SDoc
</span><a href="#local-6989586621681208928"><span class="hs-identifier hs-var hs-var">invalidLdErr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Tables-next-to-code not supported on ARM&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-541"></span><span>                   </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;when using binutils ld (please see:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-542"></span><span>                   </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;https://sourceware.org/bugzilla/show_bug.cgi?id=16177)&quot;</span></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span id="local-6989586621681209862"><span class="annot"><a href="GHC.html#checkBrokenTablesNextToCode%27"><span class="hs-identifier hs-type">checkBrokenTablesNextToCode'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209862"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209862"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-545"></span><span id="checkBrokenTablesNextToCode%27"><span class="annot"><span class="annottext">checkBrokenTablesNextToCode' :: forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#checkBrokenTablesNextToCode%27"><span class="hs-identifier hs-var hs-var">checkBrokenTablesNextToCode'</span></a></span></span><span> </span><span id="local-6989586621681208914"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208914"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-546"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Arch -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#isARM"><span class="hs-identifier hs-var">isARM</span></a></span><span> </span><span class="annot"><span class="annottext">Arch
</span><a href="#local-6989586621681208911"><span class="hs-identifier hs-var">arch</span></a></span><span class="hs-special">)</span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-547"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Way
</span><a href="GHC.Driver.Ways.html#WayDyn"><span class="hs-identifier hs-var">WayDyn</span></a></span><span> </span><span class="annot"><span class="annottext">Way -&gt; Set Way -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#notMember"><span class="hs-operator hs-var">`S.notMember`</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208914"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-548"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208907"><span class="hs-identifier hs-var">tablesNextToCode</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-549"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-550"></span><span>    </span><span id="local-6989586621681208906"><span class="annot"><span class="annottext">LinkerInfo
</span><a href="#local-6989586621681208906"><span class="hs-identifier hs-var">linkerInfo</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO LinkerInfo -&gt; m LinkerInfo
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO LinkerInfo -&gt; m LinkerInfo) -&gt; IO LinkerInfo -&gt; m LinkerInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO LinkerInfo
</span><a href="GHC.SysTools.Info.html#getLinkerInfo"><span class="hs-identifier hs-var">getLinkerInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208914"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-551"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LinkerInfo
</span><a href="#local-6989586621681208906"><span class="hs-identifier hs-var">linkerInfo</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-552"></span><span>      </span><span class="annot"><a href="GHC.Driver.Session.html#GnuLD"><span class="hs-identifier hs-type">GnuLD</span></a></span><span> </span><span class="annot"><span class="annottext">[Option]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-553"></span><span>      </span><span class="annot"><span class="annottext">LinkerInfo
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-554"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681208903"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681208903"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208914"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-555"></span><span>        </span><span id="local-6989586621681208911"><span class="annot"><span class="annottext">arch :: Arch
</span><a href="#local-6989586621681208911"><span class="hs-identifier hs-var hs-var">arch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformArch"><span class="hs-identifier hs-var">platformArch</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681208903"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-556"></span><span>        </span><span id="local-6989586621681208907"><span class="annot"><span class="annottext">tablesNextToCode :: Bool
</span><a href="#local-6989586621681208907"><span class="hs-identifier hs-var hs-var">tablesNextToCode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformTablesNextToCode"><span class="hs-identifier hs-var hs-var">platformTablesNextToCode</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681208903"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-560"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-561"></span><span class="hs-comment">--             Flags &amp; settings</span><span>
</span><span id="line-562"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-563"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span class="hs-comment">-- $DynFlags</span><span>
</span><span id="line-566"></span><span class="hs-comment">--</span><span>
</span><span id="line-567"></span><span class="hs-comment">-- The GHC session maintains two sets of 'DynFlags':</span><span>
</span><span id="line-568"></span><span class="hs-comment">--</span><span>
</span><span id="line-569"></span><span class="hs-comment">--   * The &quot;interactive&quot; @DynFlags@, which are used for everything</span><span>
</span><span id="line-570"></span><span class="hs-comment">--     related to interactive evaluation, including 'runStmt',</span><span>
</span><span id="line-571"></span><span class="hs-comment">--     'runDecls', 'exprType', 'lookupName' and so on (everything</span><span>
</span><span id="line-572"></span><span class="hs-comment">--     under \&quot;Interactive evaluation\&quot; in this module).</span><span>
</span><span id="line-573"></span><span class="hs-comment">--</span><span>
</span><span id="line-574"></span><span class="hs-comment">--   * The &quot;program&quot; @DynFlags@, which are used when loading</span><span>
</span><span id="line-575"></span><span class="hs-comment">--     whole modules with 'load'</span><span>
</span><span id="line-576"></span><span class="hs-comment">--</span><span>
</span><span id="line-577"></span><span class="hs-comment">-- 'setInteractiveDynFlags', 'getInteractiveDynFlags' work with the</span><span>
</span><span id="line-578"></span><span class="hs-comment">-- interactive @DynFlags@.</span><span>
</span><span id="line-579"></span><span class="hs-comment">--</span><span>
</span><span id="line-580"></span><span class="hs-comment">-- 'setProgramDynFlags', 'getProgramDynFlags' work with the</span><span>
</span><span id="line-581"></span><span class="hs-comment">-- program @DynFlags@.</span><span>
</span><span id="line-582"></span><span class="hs-comment">--</span><span>
</span><span id="line-583"></span><span class="hs-comment">-- 'setSessionDynFlags' sets both @DynFlags@, and 'getSessionDynFlags'</span><span>
</span><span id="line-584"></span><span class="hs-comment">-- retrieves the program @DynFlags@ (for backwards compatibility).</span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span>
</span><span id="line-587"></span><span class="hs-comment">-- | Updates both the interactive and program DynFlags in a Session.</span><span>
</span><span id="line-588"></span><span class="hs-comment">-- This also reads the package database (unless it has already been</span><span>
</span><span id="line-589"></span><span class="hs-comment">-- read), and prepares the compilers knowledge about packages.  It can</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- be called again to load new packages: just add new package flags to</span><span>
</span><span id="line-591"></span><span class="hs-comment">-- (packageFlags dflags).</span><span>
</span><span id="line-592"></span><span class="hs-comment">--</span><span>
</span><span id="line-593"></span><span class="hs-comment">-- Returns a list of new packages that may need to be linked in using</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- the dynamic linker (see 'linkPackages') as a result of new package</span><span>
</span><span id="line-595"></span><span class="hs-comment">-- flags.  If you are not doing linking or doing static linking, you</span><span>
</span><span id="line-596"></span><span class="hs-comment">-- can ignore the list of packages returned.</span><span>
</span><span id="line-597"></span><span class="hs-comment">--</span><span>
</span><span id="line-598"></span><span id="local-6989586621681209848"><span class="annot"><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-type">setSessionDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209848"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209848"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-599"></span><span id="setSessionDynFlags"><span class="annot"><span class="annottext">setSessionDynFlags :: forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var hs-var">setSessionDynFlags</span></a></span></span><span> </span><span id="local-6989586621681208870"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-600"></span><span>  </span><span id="local-6989586621681208869"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208869"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewDynFlags"><span class="hs-identifier hs-var">checkNewDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-601"></span><span>  </span><span id="local-6989586621681208867"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208867"><span class="hs-identifier hs-var">dflags'''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO DynFlags -&gt; m DynFlags) -&gt; IO DynFlags -&gt; m DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
</span><a href="GHC.Unit.State.html#initUnits"><span class="hs-identifier hs-var">initUnits</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208869"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span>  </span><span class="hs-comment">-- Interpreter</span><span>
</span><span id="line-604"></span><span>  </span><span id="local-6989586621681208865"><span class="annot"><span class="annottext">Maybe Interp
</span><a href="#local-6989586621681208865"><span class="hs-identifier hs-var">interp</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_ExternalInterpreter"><span class="hs-identifier hs-var">Opt_ExternalInterpreter</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-605"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-606"></span><span>         </span><span class="hs-keyword">let</span><span>
</span><span id="line-607"></span><span>           </span><span id="local-6989586621681208863"><span class="annot"><span class="annottext">prog :: FilePath
</span><a href="#local-6989586621681208863"><span class="hs-identifier hs-var hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath
</span><a href="GHC.Driver.Session.html#pgm_i"><span class="hs-identifier hs-var">pgm_i</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208861"><span class="hs-identifier hs-var">flavour</span></a></span><span>
</span><span id="line-608"></span><span>           </span><span id="local-6989586621681208860"><span class="annot"><span class="annottext">profiled :: Bool
</span><a href="#local-6989586621681208860"><span class="hs-identifier hs-var hs-var">profiled</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Set Way -&gt; Way -&gt; Bool
</span><a href="GHC.Driver.Ways.html#hasWay"><span class="hs-operator hs-var">`hasWay`</span></a></span><span> </span><span class="annot"><span class="annottext">Way
</span><a href="GHC.Driver.Ways.html#WayProf"><span class="hs-identifier hs-var">WayProf</span></a></span><span>
</span><span id="line-609"></span><span>           </span><span id="local-6989586621681208857"><span class="annot"><span class="annottext">dynamic :: Bool
</span><a href="#local-6989586621681208857"><span class="hs-keyword hs-var hs-var">dynamic</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Set Way -&gt; Way -&gt; Bool
</span><a href="GHC.Driver.Ways.html#hasWay"><span class="hs-operator hs-var">`hasWay`</span></a></span><span> </span><span class="annot"><span class="annottext">Way
</span><a href="GHC.Driver.Ways.html#WayDyn"><span class="hs-identifier hs-var">WayDyn</span></a></span><span>
</span><span id="line-610"></span><span>           </span><span id="local-6989586621681208861"><span class="annot"><span class="annottext">flavour :: FilePath
</span><a href="#local-6989586621681208861"><span class="hs-identifier hs-var hs-var">flavour</span></a></span></span><span>
</span><span id="line-611"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208860"><span class="hs-identifier hs-var">profiled</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-prof&quot;</span></span><span> </span><span class="hs-comment">-- FIXME: can't we have both?</span><span>
</span><span id="line-612"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208857"><span class="hs-keyword hs-var">dynamic</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-dyn&quot;</span></span><span>
</span><span id="line-613"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-614"></span><span>           </span><span id="local-6989586621681208856"><span class="annot"><span class="annottext">msg :: SDoc
</span><a href="#local-6989586621681208856"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Starting &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208863"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-615"></span><span>         </span><span id="local-6989586621681208854"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681208854"><span class="hs-identifier hs-var">tr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span>
</span><span id="line-616"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m (IO ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; SDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultDumpStyle"><span class="hs-identifier hs-var">defaultDumpStyle</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681208856"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m (IO ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-618"></span><span>         </span><span class="hs-keyword">let</span><span>
</span><span id="line-619"></span><span>          </span><span id="local-6989586621681208849"><span class="annot"><span class="annottext">conf :: IServConfig
</span><a href="#local-6989586621681208849"><span class="hs-identifier hs-var hs-var">conf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IServConfig :: FilePath
-&gt; [FilePath]
-&gt; Bool
-&gt; Bool
-&gt; Maybe (CreateProcess -&gt; IO ProcessHandle)
-&gt; IO ()
-&gt; IServConfig
</span><a href="GHC.Runtime.Interpreter.Types.html#IServConfig"><span class="hs-identifier hs-type">IServConfig</span></a></span><span>
</span><span id="line-620"></span><span>            </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">iservConfProgram :: FilePath
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfProgram"><span class="hs-identifier hs-var">iservConfProgram</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208863"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-621"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">iservConfOpts :: [FilePath]
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfOpts"><span class="hs-identifier hs-var">iservConfOpts</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; (DynFlags -&gt; [FilePath]) -&gt; [FilePath]
forall a. DynFlags -&gt; (DynFlags -&gt; [a]) -&gt; [a]
</span><a href="GHC.Driver.Session.html#getOpts"><span class="hs-identifier hs-var">getOpts</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [FilePath]
</span><a href="GHC.Driver.Session.html#opt_i"><span class="hs-identifier hs-var">opt_i</span></a></span><span>
</span><span id="line-622"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">iservConfProfiled :: Bool
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfProfiled"><span class="hs-identifier hs-var">iservConfProfiled</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208860"><span class="hs-identifier hs-var">profiled</span></a></span><span>
</span><span id="line-623"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">iservConfDynamic :: Bool
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfDynamic"><span class="hs-identifier hs-var">iservConfDynamic</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208857"><span class="hs-keyword hs-var">dynamic</span></a></span><span>
</span><span id="line-624"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">iservConfHook :: Maybe (CreateProcess -&gt; IO ProcessHandle)
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfHook"><span class="hs-identifier hs-var">iservConfHook</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Hooks -&gt; Maybe (CreateProcess -&gt; IO ProcessHandle)
</span><a href="GHC.Driver.Hooks.html#createIservProcessHook"><span class="hs-identifier hs-var hs-var">createIservProcessHook</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Hooks
</span><a href="GHC.Driver.Session.html#hooks"><span class="hs-identifier hs-var hs-var">hooks</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208870"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-625"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">iservConfTrace :: IO ()
</span><a href="GHC.Runtime.Interpreter.Types.html#iservConfTrace"><span class="hs-identifier hs-var">iservConfTrace</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681208854"><span class="hs-identifier hs-var">tr</span></a></span><span>
</span><span id="line-626"></span><span>            </span><span class="hs-special">}</span><span>
</span><span id="line-627"></span><span>         </span><span id="local-6989586621681208837"><span class="annot"><span class="annottext">MVar IServState
</span><a href="#local-6989586621681208837"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (MVar IServState) -&gt; m (MVar IServState)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (MVar IServState) -&gt; m (MVar IServState))
-&gt; IO (MVar IServState) -&gt; m (MVar IServState)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IServState -&gt; IO (MVar IServState)
forall a. a -&gt; IO (MVar a)
</span><a href="../../base/src/GHC.MVar.html#newMVar"><span class="hs-identifier hs-var">newMVar</span></a></span><span> </span><span class="annot"><span class="annottext">IServState
</span><a href="GHC.Runtime.Interpreter.Types.html#IServPending"><span class="hs-identifier hs-var">IServPending</span></a></span><span>
</span><span id="line-628"></span><span>         </span><span class="annot"><span class="annottext">Maybe Interp -&gt; m (Maybe Interp)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Interp -&gt; Maybe Interp
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IServConfig -&gt; IServ -&gt; Interp
</span><a href="GHC.Runtime.Interpreter.Types.html#ExternalInterp"><span class="hs-identifier hs-var">ExternalInterp</span></a></span><span> </span><span class="annot"><span class="annottext">IServConfig
</span><a href="#local-6989586621681208849"><span class="hs-identifier hs-var">conf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MVar IServState -&gt; IServ
</span><a href="GHC.Runtime.Interpreter.Types.html#IServ"><span class="hs-identifier hs-var">IServ</span></a></span><span> </span><span class="annot"><span class="annottext">MVar IServState
</span><a href="#local-6989586621681208837"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-629"></span><span>    </span><span class="hs-keyword">else</span><span class="hs-cpp">
#if defined(HAVE_INTERNAL_INTERPRETER)
</span><span>      </span><span class="annot"><span class="annottext">Maybe Interp -&gt; m (Maybe Interp)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Interp -&gt; Maybe Interp
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Interp
</span><a href="GHC.Runtime.Interpreter.Types.html#InternalInterp"><span class="hs-identifier hs-var">InternalInterp</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span>      </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">Nothing</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-636"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208830"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208830"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208830"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208867"><span class="hs-identifier hs-var">dflags'''</span></a></span><span>
</span><span id="line-637"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208830"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#ic_dflags"><span class="hs-identifier hs-var">ic_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208867"><span class="hs-identifier hs-var">dflags'''</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-638"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hsc_interp :: Maybe Interp
</span><a href="GHC.Driver.Types.html#hsc_interp"><span class="hs-identifier hs-var">hsc_interp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Maybe Interp
</span><a href="GHC.Driver.Types.html#hsc_interp"><span class="hs-identifier hs-var hs-var">hsc_interp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208830"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Interp -&gt; Maybe Interp -&gt; Maybe Interp
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Interp
</span><a href="#local-6989586621681208865"><span class="hs-identifier hs-var">interp</span></a></span><span>
</span><span id="line-639"></span><span>                           </span><span class="hs-comment">-- we only update the interpreter if there wasn't</span><span>
</span><span id="line-640"></span><span>                           </span><span class="hs-comment">-- already one set up</span><span>
</span><span id="line-641"></span><span>                         </span><span class="hs-special">}</span><span>
</span><span id="line-642"></span><span>  </span><span class="annot"><span class="annottext">m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; m ()
</span><a href="GHC.html#invalidateModSummaryCache"><span class="hs-identifier hs-var">invalidateModSummaryCache</span></a></span><span>
</span><span id="line-643"></span><span>
</span><span id="line-644"></span><span class="hs-comment">-- | Sets the program 'DynFlags'.  Note: this invalidates the internal</span><span>
</span><span id="line-645"></span><span class="hs-comment">-- cached module graph, causing more work to be done the next time</span><span>
</span><span id="line-646"></span><span class="hs-comment">-- 'load' is called.</span><span>
</span><span id="line-647"></span><span class="hs-comment">--</span><span>
</span><span id="line-648"></span><span class="hs-comment">-- Returns a boolean indicating if preload units have changed and need to be</span><span>
</span><span id="line-649"></span><span class="hs-comment">-- reloaded.</span><span>
</span><span id="line-650"></span><span id="local-6989586621681209823"><span class="annot"><a href="GHC.html#setProgramDynFlags"><span class="hs-identifier hs-type">setProgramDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209823"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209823"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-651"></span><span id="setProgramDynFlags"><span class="annot"><span class="annottext">setProgramDynFlags :: forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#setProgramDynFlags"><span class="hs-identifier hs-var hs-var">setProgramDynFlags</span></a></span></span><span> </span><span id="local-6989586621681208823"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208823"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DynFlags -&gt; m Bool
forall (m :: * -&gt; *). GhcMonad m =&gt; Bool -&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#setProgramDynFlags_"><span class="hs-identifier hs-var">setProgramDynFlags_</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208823"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-652"></span><span>
</span><span id="line-653"></span><span class="hs-comment">-- | Set the action taken when the compiler produces a message.  This</span><span>
</span><span id="line-654"></span><span class="hs-comment">-- can also be accomplished using 'setProgramDynFlags', but using</span><span>
</span><span id="line-655"></span><span class="hs-comment">-- 'setLogAction' avoids invalidating the cached module graph.</span><span>
</span><span id="line-656"></span><span id="local-6989586621681209820"><span class="annot"><a href="GHC.html#setLogAction"><span class="hs-identifier hs-type">setLogAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209820"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#LogAction"><span class="hs-identifier hs-type">LogAction</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209820"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-657"></span><span id="setLogAction"><span class="annot"><span class="annottext">setLogAction :: forall (m :: * -&gt; *). GhcMonad m =&gt; LogAction -&gt; m ()
</span><a href="GHC.html#setLogAction"><span class="hs-identifier hs-var hs-var">setLogAction</span></a></span></span><span> </span><span id="local-6989586621681208810"><span class="annot"><span class="annottext">LogAction
</span><a href="#local-6989586621681208810"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-658"></span><span>  </span><span id="local-6989586621681208809"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208809"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.html#getProgramDynFlags"><span class="hs-identifier hs-var">getProgramDynFlags</span></a></span><span>
</span><span id="line-659"></span><span>  </span><span class="annot"><span class="annottext">m Bool -&gt; m ()
forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="../../base/src/Data.Functor.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="annot"><span class="annottext">(m Bool -&gt; m ()) -&gt; m Bool -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DynFlags -&gt; m Bool
forall (m :: * -&gt; *). GhcMonad m =&gt; Bool -&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#setProgramDynFlags_"><span class="hs-identifier hs-var">setProgramDynFlags_</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; m Bool) -&gt; DynFlags -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-660"></span><span>    </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208809"><span class="hs-identifier hs-var">dflags'</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">log_action :: LogAction
</span><a href="GHC.Driver.Session.html#log_action"><span class="hs-identifier hs-var">log_action</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LogAction
</span><a href="#local-6989586621681208810"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-661"></span><span>
</span><span id="line-662"></span><span id="local-6989586621681209821"><span class="annot"><a href="GHC.html#setProgramDynFlags_"><span class="hs-identifier hs-type">setProgramDynFlags_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209821"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209821"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-663"></span><span id="setProgramDynFlags_"><span class="annot"><span class="annottext">setProgramDynFlags_ :: forall (m :: * -&gt; *). GhcMonad m =&gt; Bool -&gt; DynFlags -&gt; m Bool
</span><a href="GHC.html#setProgramDynFlags_"><span class="hs-identifier hs-var hs-var">setProgramDynFlags_</span></a></span></span><span> </span><span id="local-6989586621681208786"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208786"><span class="hs-identifier hs-var">invalidate_needed</span></a></span></span><span> </span><span id="local-6989586621681208785"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208785"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-664"></span><span>  </span><span id="local-6989586621681208784"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208784"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewDynFlags"><span class="hs-identifier hs-var">checkNewDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208785"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-665"></span><span>  </span><span id="local-6989586621681208783"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208783"><span class="hs-identifier hs-var">dflags_prev</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.html#getProgramDynFlags"><span class="hs-identifier hs-var">getProgramDynFlags</span></a></span><span>
</span><span id="line-666"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208782"><span class="annot"><span class="annottext">changed :: Bool
</span><a href="#local-6989586621681208782"><span class="hs-identifier hs-var hs-var">changed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#packageFlagsChanged"><span class="hs-identifier hs-var">packageFlagsChanged</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208783"><span class="hs-identifier hs-var">dflags_prev</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208784"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-667"></span><span>  </span><span id="local-6989586621681208780"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208780"><span class="hs-identifier hs-var">dflags''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208782"><span class="hs-identifier hs-var">changed</span></a></span><span>
</span><span id="line-668"></span><span>               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IO DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO DynFlags -&gt; m DynFlags) -&gt; IO DynFlags -&gt; m DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
</span><a href="GHC.Unit.State.html#initUnits"><span class="hs-identifier hs-var">initUnits</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208784"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-669"></span><span>               </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208784"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-670"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208779"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208779"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208779"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208780"><span class="hs-identifier hs-var">dflags''</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-671"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208786"><span class="hs-identifier hs-var">invalidate_needed</span></a></span><span> </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; m ()
</span><a href="GHC.html#invalidateModSummaryCache"><span class="hs-identifier hs-var">invalidateModSummaryCache</span></a></span><span>
</span><span id="line-672"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208782"><span class="hs-identifier hs-var">changed</span></a></span><span>
</span><span id="line-673"></span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span class="hs-comment">-- When changing the DynFlags, we want the changes to apply to future</span><span>
</span><span id="line-676"></span><span class="hs-comment">-- loads, but without completely discarding the program.  But the</span><span>
</span><span id="line-677"></span><span class="hs-comment">-- DynFlags are cached in each ModSummary in the hsc_mod_graph, so</span><span>
</span><span id="line-678"></span><span class="hs-comment">-- after a change to DynFlags, the changes would apply to new modules</span><span>
</span><span id="line-679"></span><span class="hs-comment">-- but not existing modules; this seems undesirable.</span><span>
</span><span id="line-680"></span><span class="hs-comment">--</span><span>
</span><span id="line-681"></span><span class="hs-comment">-- Furthermore, the GHC API client might expect that changing</span><span>
</span><span id="line-682"></span><span class="hs-comment">-- log_action would affect future compilation messages, but for those</span><span>
</span><span id="line-683"></span><span class="hs-comment">-- modules we have cached ModSummaries for, we'll continue to use the</span><span>
</span><span id="line-684"></span><span class="hs-comment">-- old log_action.  This is definitely wrong (#7478).</span><span>
</span><span id="line-685"></span><span class="hs-comment">--</span><span>
</span><span id="line-686"></span><span class="hs-comment">-- Hence, we invalidate the ModSummary cache after changing the</span><span>
</span><span id="line-687"></span><span class="hs-comment">-- DynFlags.  We do this by tweaking the date on each ModSummary, so</span><span>
</span><span id="line-688"></span><span class="hs-comment">-- that the next downsweep will think that all the files have changed</span><span>
</span><span id="line-689"></span><span class="hs-comment">-- and preprocess them again.  This won't necessarily cause everything</span><span>
</span><span id="line-690"></span><span class="hs-comment">-- to be recompiled, because by the time we check whether we need to</span><span>
</span><span id="line-691"></span><span class="hs-comment">-- recompile a module, we'll have re-summarised the module and have a</span><span>
</span><span id="line-692"></span><span class="hs-comment">-- correct ModSummary.</span><span>
</span><span id="line-693"></span><span class="hs-comment">--</span><span>
</span><span id="line-694"></span><span id="local-6989586621681209824"><span class="annot"><a href="GHC.html#invalidateModSummaryCache"><span class="hs-identifier hs-type">invalidateModSummaryCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209824"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209824"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-695"></span><span id="invalidateModSummaryCache"><span class="annot"><span class="annottext">invalidateModSummaryCache :: forall (m :: * -&gt; *). GhcMonad m =&gt; m ()
</span><a href="GHC.html#invalidateModSummaryCache"><span class="hs-identifier hs-var hs-var">invalidateModSummaryCache</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-696"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208776"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208776"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208776"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_mod_graph :: ModuleGraph
</span><a href="GHC.Driver.Types.html#hsc_mod_graph"><span class="hs-identifier hs-var">hsc_mod_graph</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; ModSummary) -&gt; ModuleGraph -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#mapMG"><span class="hs-identifier hs-var">mapMG</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; ModSummary
</span><a href="#local-6989586621681208774"><span class="hs-identifier hs-var">inval</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#hsc_mod_graph"><span class="hs-identifier hs-var hs-var">hsc_mod_graph</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208776"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-697"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-698"></span><span>  </span><span id="local-6989586621681208774"><span class="annot"><span class="annottext">inval :: ModSummary -&gt; ModSummary
</span><a href="#local-6989586621681208774"><span class="hs-identifier hs-var hs-var">inval</span></a></span></span><span> </span><span id="local-6989586621681208770"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208770"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208770"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ms_hs_date :: UTCTime
</span><a href="GHC.Driver.Types.html#ms_hs_date"><span class="hs-identifier hs-var">ms_hs_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NominalDiffTime -&gt; UTCTime -&gt; UTCTime
</span><a href="../../time/src/Data.Time.Clock.Internal.UTCDiff.html#addUTCTime"><span class="hs-identifier hs-var">addUTCTime</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">NominalDiffTime
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; UTCTime
</span><a href="GHC.Driver.Types.html#ms_hs_date"><span class="hs-identifier hs-var hs-var">ms_hs_date</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208770"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-699"></span><span>
</span><span id="line-700"></span><span class="hs-comment">-- | Returns the program 'DynFlags'.</span><span>
</span><span id="line-701"></span><span id="local-6989586621681209817"><span class="annot"><a href="GHC.html#getProgramDynFlags"><span class="hs-identifier hs-type">getProgramDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209817"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209817"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span></span><span>
</span><span id="line-702"></span><span id="getProgramDynFlags"><span class="annot"><span class="annottext">getProgramDynFlags :: forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.html#getProgramDynFlags"><span class="hs-identifier hs-var hs-var">getProgramDynFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">getSessionDynFlags</span></a></span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span class="hs-comment">-- | Set the 'DynFlags' used to evaluate interactive expressions.</span><span>
</span><span id="line-705"></span><span class="hs-comment">-- Note: this cannot be used for changes to packages.  Use</span><span>
</span><span id="line-706"></span><span class="hs-comment">-- 'setSessionDynFlags', or 'setProgramDynFlags' and then copy the</span><span>
</span><span id="line-707"></span><span class="hs-comment">-- 'unitState' into the interactive @DynFlags@.</span><span>
</span><span id="line-708"></span><span id="local-6989586621681208765"><span class="annot"><a href="GHC.html#setInteractiveDynFlags"><span class="hs-identifier hs-type">setInteractiveDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681208765"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681208765"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-709"></span><span id="setInteractiveDynFlags"><span class="annot"><span class="annottext">setInteractiveDynFlags :: forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setInteractiveDynFlags"><span class="hs-identifier hs-var hs-var">setInteractiveDynFlags</span></a></span></span><span> </span><span id="local-6989586621681208753"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208753"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-710"></span><span>  </span><span id="local-6989586621681208752"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208752"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewDynFlags"><span class="hs-identifier hs-var">checkNewDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208753"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-711"></span><span>  </span><span id="local-6989586621681208751"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208751"><span class="hs-identifier hs-var">dflags''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewInteractiveDynFlags"><span class="hs-identifier hs-var">checkNewInteractiveDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208752"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-712"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208749"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208749"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208749"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208749"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#ic_dflags"><span class="hs-identifier hs-var">ic_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208751"><span class="hs-identifier hs-var">dflags''</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-713"></span><span>
</span><span id="line-714"></span><span class="hs-comment">-- | Get the 'DynFlags' used to evaluate interactive expressions.</span><span>
</span><span id="line-715"></span><span id="local-6989586621681208748"><span class="annot"><a href="GHC.html#getInteractiveDynFlags"><span class="hs-identifier hs-type">getInteractiveDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681208748"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681208748"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span></span><span>
</span><span id="line-716"></span><span id="getInteractiveDynFlags"><span class="annot"><span class="annottext">getInteractiveDynFlags :: forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.html#getInteractiveDynFlags"><span class="hs-identifier hs-var hs-var">getInteractiveDynFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m DynFlags) -&gt; m DynFlags
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m DynFlags) -&gt; m DynFlags)
-&gt; (HscEnv -&gt; m DynFlags) -&gt; m DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208739"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208739"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InteractiveContext -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ic_dflags"><span class="hs-identifier hs-var hs-var">ic_dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208739"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-717"></span><span>
</span><span id="line-718"></span><span>
</span><span id="line-719"></span><span id="local-6989586621681209803"><span class="annot"><a href="GHC.html#parseDynamicFlags"><span class="hs-identifier hs-type">parseDynamicFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209803"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-720"></span><span>                     </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-721"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209803"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.CmdLine.html#Warn"><span class="hs-identifier hs-type">Warn</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-722"></span><span id="parseDynamicFlags"><span class="annot"><span class="annottext">parseDynamicFlags :: forall (m :: * -&gt; *).
MonadIO m =&gt;
DynFlags
-&gt; [Located FilePath] -&gt; m (DynFlags, [Located FilePath], [Warn])
</span><a href="GHC.html#parseDynamicFlags"><span class="hs-identifier hs-var hs-var">parseDynamicFlags</span></a></span></span><span> </span><span id="local-6989586621681208731"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208731"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681208730"><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208730"><span class="hs-identifier hs-var">cmdline</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-723"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681208729"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208729"><span class="hs-identifier hs-var">dflags1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208728"><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208728"><span class="hs-identifier hs-var">leftovers</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208727"><span class="annot"><span class="annottext">[Warn]
</span><a href="#local-6989586621681208727"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [Located FilePath] -&gt; m (DynFlags, [Located FilePath], [Warn])
forall (m :: * -&gt; *).
MonadIO m =&gt;
DynFlags
-&gt; [Located FilePath] -&gt; m (DynFlags, [Located FilePath], [Warn])
</span><a href="GHC.Driver.Session.html#parseDynamicFlagsCmdLine"><span class="hs-identifier hs-var">parseDynamicFlagsCmdLine</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208731"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208730"><span class="hs-identifier hs-var">cmdline</span></a></span><span>
</span><span id="line-724"></span><span>  </span><span id="local-6989586621681208725"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208725"><span class="hs-identifier hs-var">dflags2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO DynFlags -&gt; m DynFlags) -&gt; IO DynFlags -&gt; m DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
</span><a href="GHC.html#interpretPackageEnv"><span class="hs-identifier hs-var">interpretPackageEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208729"><span class="hs-identifier hs-var">dflags1</span></a></span><span>
</span><span id="line-725"></span><span>  </span><span class="annot"><span class="annottext">(DynFlags, [Located FilePath], [Warn])
-&gt; m (DynFlags, [Located FilePath], [Warn])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208725"><span class="hs-identifier hs-var">dflags2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208728"><span class="hs-identifier hs-var">leftovers</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Warn]
</span><a href="#local-6989586621681208727"><span class="hs-identifier hs-var">warns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span class="hs-comment">-- | Checks the set of new DynFlags for possibly erroneous option</span><span>
</span><span id="line-729"></span><span class="hs-comment">-- combinations when invoking 'setSessionDynFlags' and friends, and if</span><span>
</span><span id="line-730"></span><span class="hs-comment">-- found, returns a fixed copy (if possible).</span><span>
</span><span id="line-731"></span><span id="local-6989586621681209846"><span class="annot"><a href="GHC.html#checkNewDynFlags"><span class="hs-identifier hs-type">checkNewDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209846"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209846"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span></span><span>
</span><span id="line-732"></span><span id="checkNewDynFlags"><span class="annot"><span class="annottext">checkNewDynFlags :: forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewDynFlags"><span class="hs-identifier hs-var hs-var">checkNewDynFlags</span></a></span></span><span> </span><span id="local-6989586621681208719"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208719"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-733"></span><span>  </span><span class="hs-comment">-- See Note [DynFlags consistency]</span><span>
</span><span id="line-734"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208718"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208718"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208717"><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208717"><span class="hs-identifier hs-var">warnings</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; (DynFlags, [Located FilePath])
</span><a href="GHC.Driver.Session.html#makeDynFlagsConsistent"><span class="hs-identifier hs-var">makeDynFlagsConsistent</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208719"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-735"></span><span>  </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [Warn] -&gt; IO ()
</span><a href="GHC.Driver.Types.html#handleFlagWarnings"><span class="hs-identifier hs-var">handleFlagWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208719"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located FilePath -&gt; Warn) -&gt; [Located FilePath] -&gt; [Warn]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarnReason -&gt; Located FilePath -&gt; Warn
</span><a href="GHC.Driver.CmdLine.html#Warn"><span class="hs-identifier hs-var">Warn</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.CmdLine.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681208717"><span class="hs-identifier hs-var">warnings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-736"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208718"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-737"></span><span>
</span><span id="line-738"></span><span id="local-6989586621681208712"><span class="annot"><a href="GHC.html#checkNewInteractiveDynFlags"><span class="hs-identifier hs-type">checkNewInteractiveDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681208712"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681208712"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span></span><span>
</span><span id="line-739"></span><span id="checkNewInteractiveDynFlags"><span class="annot"><span class="annottext">checkNewInteractiveDynFlags :: forall (m :: * -&gt; *). MonadIO m =&gt; DynFlags -&gt; m DynFlags
</span><a href="GHC.html#checkNewInteractiveDynFlags"><span class="hs-identifier hs-var hs-var">checkNewInteractiveDynFlags</span></a></span></span><span> </span><span id="local-6989586621681208705"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-740"></span><span>  </span><span class="hs-comment">-- We currently don't support use of StaticPointers in expressions entered on</span><span>
</span><span id="line-741"></span><span>  </span><span class="hs-comment">-- the REPL. See #12356.</span><span>
</span><span id="line-742"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#StaticPointers"><span class="hs-identifier hs-var">LangExt.StaticPointers</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span><span>
</span><span id="line-743"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bag WarnMsg -&gt; IO ()
</span><a href="GHC.Driver.Types.html#printOrThrowWarnings"><span class="hs-identifier hs-var">printOrThrowWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span><span> </span><span class="annot"><span class="annottext">(Bag WarnMsg -&gt; IO ()) -&gt; Bag WarnMsg -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[WarnMsg] -&gt; Bag WarnMsg
forall a. [a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#listToBag"><span class="hs-identifier hs-var">listToBag</span></a></span><span>
</span><span id="line-744"></span><span>            </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; SDoc -&gt; WarnMsg
</span><a href="GHC.Utils.Error.html#mkPlainWarnMsg"><span class="hs-identifier hs-var">mkPlainWarnMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#interactiveSrcSpan"><span class="hs-identifier hs-var">interactiveSrcSpan</span></a></span><span>
</span><span id="line-745"></span><span>             </span><span class="annot"><span class="annottext">(SDoc -&gt; WarnMsg) -&gt; SDoc -&gt; WarnMsg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;StaticPointers is not supported in GHCi interactive expressions.&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-746"></span><span>          </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; m DynFlags) -&gt; DynFlags -&gt; m DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Extension -&gt; DynFlags
</span><a href="GHC.Driver.Session.html#xopt_unset"><span class="hs-identifier hs-var">xopt_unset</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#StaticPointers"><span class="hs-identifier hs-var">LangExt.StaticPointers</span></a></span><span>
</span><span id="line-747"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; m DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208705"><span class="hs-identifier hs-var">dflags0</span></a></span><span>
</span><span id="line-748"></span><span>
</span><span id="line-749"></span><span>
</span><span id="line-750"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-751"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-752"></span><span class="hs-comment">--             Setting, getting, and modifying the targets</span><span>
</span><span id="line-753"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-754"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-755"></span><span>
</span><span id="line-756"></span><span class="hs-comment">-- ToDo: think about relative vs. absolute file paths. And what</span><span>
</span><span id="line-757"></span><span class="hs-comment">-- happens when the current directory changes.</span><span>
</span><span id="line-758"></span><span>
</span><span id="line-759"></span><span class="hs-comment">-- | Sets the targets for this session.  Each target may be a module name</span><span>
</span><span id="line-760"></span><span class="hs-comment">-- or a filename.  The targets correspond to the set of root modules for</span><span>
</span><span id="line-761"></span><span class="hs-comment">-- the program\/library.  Unloading the current program is achieved by</span><span>
</span><span id="line-762"></span><span class="hs-comment">-- setting the current set of targets to be empty, followed by 'load'.</span><span>
</span><span id="line-763"></span><span id="local-6989586621681209789"><span class="annot"><a href="GHC.html#setTargets"><span class="hs-identifier hs-type">setTargets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209789"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-type">Target</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209789"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-764"></span><span id="setTargets"><span class="annot"><span class="annottext">setTargets :: forall (m :: * -&gt; *). GhcMonad m =&gt; [Target] -&gt; m ()
</span><a href="GHC.html#setTargets"><span class="hs-identifier hs-var hs-var">setTargets</span></a></span></span><span> </span><span id="local-6989586621681208696"><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681208696"><span class="hs-identifier hs-var">targets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681208695"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208695"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208695"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_targets :: [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var">hsc_targets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681208696"><span class="hs-identifier hs-var">targets</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span class="hs-comment">-- | Returns the current set of targets</span><span>
</span><span id="line-767"></span><span id="local-6989586621681209786"><span class="annot"><a href="GHC.html#getTargets"><span class="hs-identifier hs-type">getTargets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209786"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209786"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-type">Target</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-768"></span><span id="getTargets"><span class="annot"><span class="annottext">getTargets :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [Target]
</span><a href="GHC.html#getTargets"><span class="hs-identifier hs-var hs-var">getTargets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [Target]) -&gt; m [Target]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Target] -&gt; m [Target]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Target] -&gt; m [Target])
-&gt; (HscEnv -&gt; [Target]) -&gt; HscEnv -&gt; m [Target]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var hs-var">hsc_targets</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span class="hs-comment">-- | Add another target.</span><span>
</span><span id="line-771"></span><span id="local-6989586621681209781"><span class="annot"><a href="GHC.html#addTarget"><span class="hs-identifier hs-type">addTarget</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209781"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-type">Target</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209781"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-772"></span><span id="addTarget"><span class="annot"><span class="annottext">addTarget :: forall (m :: * -&gt; *). GhcMonad m =&gt; Target -&gt; m ()
</span><a href="GHC.html#addTarget"><span class="hs-identifier hs-var hs-var">addTarget</span></a></span></span><span> </span><span id="local-6989586621681208683"><span class="annot"><span class="annottext">Target
</span><a href="#local-6989586621681208683"><span class="hs-identifier hs-var">target</span></a></span></span><span>
</span><span id="line-773"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681208682"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208682"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208682"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_targets :: [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var">hsc_targets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Target
</span><a href="#local-6989586621681208683"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="annot"><span class="annottext">Target -&gt; [Target] -&gt; [Target]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var hs-var">hsc_targets</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208682"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-774"></span><span>
</span><span id="line-775"></span><span class="hs-comment">-- | Remove a target</span><span>
</span><span id="line-776"></span><span id="local-6989586621681209779"><span class="annot"><a href="GHC.html#removeTarget"><span class="hs-identifier hs-type">removeTarget</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209779"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#TargetId"><span class="hs-identifier hs-type">TargetId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209779"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-777"></span><span id="removeTarget"><span class="annot"><span class="annottext">removeTarget :: forall (m :: * -&gt; *). GhcMonad m =&gt; TargetId -&gt; m ()
</span><a href="GHC.html#removeTarget"><span class="hs-identifier hs-var hs-var">removeTarget</span></a></span></span><span> </span><span id="local-6989586621681208677"><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208677"><span class="hs-identifier hs-var">target_id</span></a></span></span><span>
</span><span id="line-778"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681208676"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208676"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208676"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_targets :: [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var">hsc_targets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Target] -&gt; [Target]
</span><a href="#local-6989586621681208675"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; [Target]
</span><a href="GHC.Driver.Types.html#hsc_targets"><span class="hs-identifier hs-var hs-var">hsc_targets</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208676"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-779"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-780"></span><span>   </span><span id="local-6989586621681208675"><span class="annot"><span class="annottext">filter :: [Target] -&gt; [Target]
</span><a href="#local-6989586621681208675"><span class="hs-identifier hs-var hs-var">filter</span></a></span></span><span> </span><span id="local-6989586621681208674"><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681208674"><span class="hs-identifier hs-var">targets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Target
</span><a href="#local-6989586621681208673"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681208673"><span class="annot"><span class="annottext">t :: Target
</span><a href="#local-6989586621681208673"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-type">Target</span></a></span><span> </span><span id="local-6989586621681208671"><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208671"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe (InputFileBuffer, UTCTime)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681208674"><span class="hs-identifier hs-var">targets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208671"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">TargetId -&gt; TargetId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208677"><span class="hs-identifier hs-var">target_id</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-781"></span><span>
</span><span id="line-782"></span><span class="hs-comment">-- | Attempts to guess what Target a string refers to.  This function</span><span>
</span><span id="line-783"></span><span class="hs-comment">-- implements the @--make@/GHCi command-line syntax for filenames:</span><span>
</span><span id="line-784"></span><span class="hs-comment">--</span><span>
</span><span id="line-785"></span><span class="hs-comment">--   - if the string looks like a Haskell source filename, then interpret it</span><span>
</span><span id="line-786"></span><span class="hs-comment">--     as such</span><span>
</span><span id="line-787"></span><span class="hs-comment">--</span><span>
</span><span id="line-788"></span><span class="hs-comment">--   - if adding a .hs or .lhs suffix yields the name of an existing file,</span><span>
</span><span id="line-789"></span><span class="hs-comment">--     then use that</span><span>
</span><span id="line-790"></span><span class="hs-comment">--</span><span>
</span><span id="line-791"></span><span class="hs-comment">--   - otherwise interpret the string as a module name</span><span>
</span><span id="line-792"></span><span class="hs-comment">--</span><span>
</span><span id="line-793"></span><span id="local-6989586621681209774"><span class="annot"><a href="GHC.html#guessTarget"><span class="hs-identifier hs-type">guessTarget</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209774"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#Phase"><span class="hs-identifier hs-type">Phase</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209774"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-type">Target</span></a></span></span><span>
</span><span id="line-794"></span><span id="guessTarget"><span class="annot"><span class="annottext">guessTarget :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
FilePath -&gt; Maybe Phase -&gt; m Target
</span><a href="GHC.html#guessTarget"><span class="hs-identifier hs-var hs-var">guessTarget</span></a></span></span><span> </span><span id="local-6989586621681208649"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208649"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208648"><span class="annot"><span class="annottext">Phase
</span><a href="#local-6989586621681208648"><span class="hs-identifier hs-var">phase</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-795"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Target -&gt; m Target
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TargetId -&gt; Bool -&gt; Maybe (InputFileBuffer, UTCTime) -&gt; Target
</span><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-var">Target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; TargetId
</span><a href="GHC.Driver.Types.html#TargetFile"><span class="hs-identifier hs-var">TargetFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208649"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Phase -&gt; Maybe Phase
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Phase
</span><a href="#local-6989586621681208648"><span class="hs-identifier hs-var">phase</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">Maybe (InputFileBuffer, UTCTime)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-796"></span><span class="annot"><a href="GHC.html#guessTarget"><span class="hs-identifier hs-var">guessTarget</span></a></span><span> </span><span id="local-6989586621681208646"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208646"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-797"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
</span><a href="GHC.Driver.Phases.html#isHaskellSrcFilename"><span class="hs-identifier hs-var">isHaskellSrcFilename</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-798"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Target -&gt; m Target
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TargetId -&gt; Target
</span><a href="#local-6989586621681208644"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; TargetId
</span><a href="GHC.Driver.Types.html#TargetFile"><span class="hs-identifier hs-var">TargetFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-799"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-800"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681208643"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208643"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; m Bool
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Bool -&gt; m Bool) -&gt; IO Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208641"><span class="hs-identifier hs-var">hs_file</span></a></span><span>
</span><span id="line-801"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208643"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-802"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Target -&gt; m Target
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TargetId -&gt; Target
</span><a href="#local-6989586621681208644"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; TargetId
</span><a href="GHC.Driver.Types.html#TargetFile"><span class="hs-identifier hs-var">TargetFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208641"><span class="hs-identifier hs-var">hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-804"></span><span>        </span><span id="local-6989586621681208640"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208640"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; m Bool
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Bool -&gt; m Bool) -&gt; IO Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208639"><span class="hs-identifier hs-var">lhs_file</span></a></span><span>
</span><span id="line-805"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208640"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-806"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Target -&gt; m Target
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TargetId -&gt; Target
</span><a href="#local-6989586621681208644"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; TargetId
</span><a href="GHC.Driver.Types.html#TargetFile"><span class="hs-identifier hs-var">TargetFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208639"><span class="hs-identifier hs-var">lhs_file</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-808"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
</span><a href="GHC.Utils.Misc.html#looksLikeModuleName"><span class="hs-identifier hs-var">looksLikeModuleName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-809"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Target -&gt; m Target
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TargetId -&gt; Target
</span><a href="#local-6989586621681208644"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; TargetId
</span><a href="GHC.Driver.Types.html#TargetModule"><span class="hs-identifier hs-var">TargetModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; ModuleName
</span><a href="GHC.Unit.Module.Name.html#mkModuleName"><span class="hs-identifier hs-var">mkModuleName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-811"></span><span>        </span><span id="local-6989586621681208636"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208636"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-812"></span><span>        </span><span class="annot"><span class="annottext">IO Target -&gt; m Target
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Target -&gt; m Target) -&gt; IO Target -&gt; m Target
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO Target
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span>
</span><span id="line-813"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208636"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; FilePath) -&gt; SDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-814"></span><span>                 </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;target&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-815"></span><span>                 </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;is not a module name or a source file&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-816"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-817"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681208645"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681208630"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208630"><span class="hs-identifier hs-var">obj_allowed</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-818"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681208629"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208629"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208646"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208629"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-819"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208646"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-820"></span><span>
</span><span id="line-821"></span><span>         </span><span id="local-6989586621681208641"><span class="annot"><span class="annottext">hs_file :: FilePath
</span><a href="#local-6989586621681208641"><span class="hs-identifier hs-var hs-var">hs_file</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hs&quot;</span></span><span>
</span><span id="line-822"></span><span>         </span><span id="local-6989586621681208639"><span class="annot"><span class="annottext">lhs_file :: FilePath
</span><a href="#local-6989586621681208639"><span class="hs-identifier hs-var hs-var">lhs_file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208645"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;lhs&quot;</span></span><span>
</span><span id="line-823"></span><span>
</span><span id="line-824"></span><span>         </span><span id="local-6989586621681208644"><span class="annot"><span class="annottext">target :: TargetId -&gt; Target
</span><a href="#local-6989586621681208644"><span class="hs-identifier hs-var hs-var">target</span></a></span></span><span> </span><span id="local-6989586621681208627"><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208627"><span class="hs-identifier hs-var">tid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TargetId -&gt; Bool -&gt; Maybe (InputFileBuffer, UTCTime) -&gt; Target
</span><a href="GHC.Driver.Types.html#Target"><span class="hs-identifier hs-var">Target</span></a></span><span> </span><span class="annot"><span class="annottext">TargetId
</span><a href="#local-6989586621681208627"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208630"><span class="hs-identifier hs-var">obj_allowed</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (InputFileBuffer, UTCTime)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-825"></span><span>
</span><span id="line-826"></span><span>
</span><span id="line-827"></span><span class="hs-comment">-- | Inform GHC that the working directory has changed.  GHC will flush</span><span>
</span><span id="line-828"></span><span class="hs-comment">-- its cache of module locations, since it may no longer be valid.</span><span>
</span><span id="line-829"></span><span class="hs-comment">--</span><span>
</span><span id="line-830"></span><span class="hs-comment">-- Note: Before changing the working directory make sure all threads running</span><span>
</span><span id="line-831"></span><span class="hs-comment">-- in the same session have stopped.  If you change the working directory,</span><span>
</span><span id="line-832"></span><span class="hs-comment">-- you should also unload the current program (set targets to empty,</span><span>
</span><span id="line-833"></span><span class="hs-comment">-- followed by load).</span><span>
</span><span id="line-834"></span><span id="local-6989586621681208626"><span class="annot"><a href="GHC.html#workingDirectoryChanged"><span class="hs-identifier hs-type">workingDirectoryChanged</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681208626"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681208626"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-835"></span><span id="workingDirectoryChanged"><span class="annot"><span class="annottext">workingDirectoryChanged :: forall (m :: * -&gt; *). GhcMonad m =&gt; m ()
</span><a href="GHC.html#workingDirectoryChanged"><span class="hs-identifier hs-var hs-var">workingDirectoryChanged</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ()) -&gt; m ()
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m ()) -&gt; m ()) -&gt; (HscEnv -&gt; m ()) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; (HscEnv -&gt; IO ()) -&gt; HscEnv -&gt; m ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#flushFinderCaches"><span class="hs-identifier hs-var">flushFinderCaches</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-836"></span><span>
</span><span id="line-837"></span><span>
</span><span id="line-838"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-839"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-840"></span><span class="hs-comment">--             Running phases one at a time</span><span>
</span><span id="line-841"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-842"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-843"></span><span>
</span><span id="line-844"></span><span class="hs-keyword">class</span><span> </span><span id="ParsedMod"><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier hs-var">ParsedMod</span></a></span></span><span> </span><span id="local-6989586621681209758"><span class="annot"><a href="#local-6989586621681209758"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-845"></span><span>  </span><span id="modSummary"><span class="annot"><a href="GHC.html#modSummary"><span class="hs-identifier hs-type">modSummary</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209758"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-846"></span><span>  </span><span id="parsedSource"><span class="annot"><a href="GHC.html#parsedSource"><span class="hs-identifier hs-type">parsedSource</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209758"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.html#ParsedSource"><span class="hs-identifier hs-type">ParsedSource</span></a></span><span>
</span><span id="line-847"></span><span>
</span><span id="line-848"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier hs-type">ParsedMod</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="TypecheckedMod"><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier hs-var">TypecheckedMod</span></a></span></span><span> </span><span id="local-6989586621681209766"><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-849"></span><span>  </span><span id="renamedSource"><span class="annot"><a href="GHC.html#renamedSource"><span class="hs-identifier hs-type">renamedSource</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.html#RenamedSource"><span class="hs-identifier hs-type">RenamedSource</span></a></span><span>
</span><span id="line-850"></span><span>  </span><span id="typecheckedSource"><span class="annot"><a href="GHC.html#typecheckedSource"><span class="hs-identifier hs-type">typecheckedSource</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedSource"><span class="hs-identifier hs-type">TypecheckedSource</span></a></span><span>
</span><span id="line-851"></span><span>  </span><span id="moduleInfo"><span class="annot"><a href="GHC.html#moduleInfo"><span class="hs-identifier hs-type">moduleInfo</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span>
</span><span id="line-852"></span><span>  </span><span id="tm_internals"><span class="annot"><a href="GHC.html#tm_internals"><span class="hs-identifier hs-type">tm_internals</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209766"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModDetails"><span class="hs-identifier hs-type">ModDetails</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-853"></span><span>        </span><span class="hs-comment">-- ToDo: improvements that could be made here:</span><span>
</span><span id="line-854"></span><span>        </span><span class="hs-comment">--  if the module succeeded renaming but not typechecking,</span><span>
</span><span id="line-855"></span><span>        </span><span class="hs-comment">--  we can still get back the GlobalRdrEnv and exports, so</span><span>
</span><span id="line-856"></span><span>        </span><span class="hs-comment">--  perhaps the ModuleInfo should be split up into separate</span><span>
</span><span id="line-857"></span><span>        </span><span class="hs-comment">--  fields.</span><span>
</span><span id="line-858"></span><span>
</span><span id="line-859"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier hs-type">TypecheckedMod</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209763"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="DesugaredMod"><span class="annot"><a href="GHC.html#DesugaredMod"><span class="hs-identifier hs-var">DesugaredMod</span></a></span></span><span> </span><span id="local-6989586621681209763"><span class="annot"><a href="#local-6989586621681209763"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-860"></span><span>  </span><span id="coreModule"><span class="annot"><a href="GHC.html#coreModule"><span class="hs-identifier hs-type">coreModule</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681209763"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-861"></span><span>
</span><span id="line-862"></span><span class="hs-comment">-- | The result of successful parsing.</span><span>
</span><span id="line-863"></span><span class="hs-keyword">data</span><span> </span><span id="ParsedModule"><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-var">ParsedModule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-864"></span><span>  </span><span id="ParsedModule"><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-var">ParsedModule</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="pm_mod_summary"><span class="annot"><span class="annottext">ParsedModule -&gt; ModSummary
</span><a href="GHC.html#pm_mod_summary"><span class="hs-identifier hs-var hs-var">pm_mod_summary</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-865"></span><span>               </span><span class="hs-special">,</span><span> </span><span id="pm_parsed_source"><span class="annot"><span class="annottext">ParsedModule -&gt; ParsedSource
</span><a href="GHC.html#pm_parsed_source"><span class="hs-identifier hs-var hs-var">pm_parsed_source</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ParsedSource"><span class="hs-identifier hs-type">ParsedSource</span></a></span><span>
</span><span id="line-866"></span><span>               </span><span class="hs-special">,</span><span> </span><span id="pm_extra_src_files"><span class="annot"><span class="annottext">ParsedModule -&gt; [FilePath]
</span><a href="GHC.html#pm_extra_src_files"><span class="hs-identifier hs-var hs-var">pm_extra_src_files</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-867"></span><span>               </span><span class="hs-special">,</span><span> </span><span id="pm_annotations"><span class="annot"><span class="annottext">ParsedModule -&gt; ApiAnns
</span><a href="GHC.html#pm_annotations"><span class="hs-identifier hs-var hs-var">pm_annotations</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html#ApiAnns"><span class="hs-identifier hs-type">ApiAnns</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-868"></span><span>               </span><span class="hs-comment">-- See Note [Api annotations] in GHC.Parser.Annotation</span><span>
</span><span id="line-869"></span><span>
</span><span id="line-870"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier hs-type">ParsedMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-type">ParsedModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-871"></span><span>  </span><span id="local-6989586621681208606"><span class="annot"><span class="annottext">modSummary :: ParsedModule -&gt; ModSummary
</span><a href="#local-6989586621681208606"><span class="hs-identifier hs-var hs-var hs-var hs-var">modSummary</span></a></span></span><span> </span><span id="local-6989586621681208605"><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208605"><span class="hs-identifier hs-var">m</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ModSummary
</span><a href="GHC.html#pm_mod_summary"><span class="hs-identifier hs-var hs-var">pm_mod_summary</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208605"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-872"></span><span>  </span><span id="local-6989586621681208604"><span class="annot"><span class="annottext">parsedSource :: ParsedModule -&gt; ParsedSource
</span><a href="#local-6989586621681208604"><span class="hs-identifier hs-var hs-var hs-var hs-var">parsedSource</span></a></span></span><span> </span><span id="local-6989586621681208603"><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208603"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ParsedSource
</span><a href="GHC.html#pm_parsed_source"><span class="hs-identifier hs-var hs-var">pm_parsed_source</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208603"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-873"></span><span>
</span><span id="line-874"></span><span class="hs-comment">-- | The result of successful typechecking.  It also contains the parser</span><span>
</span><span id="line-875"></span><span class="hs-comment">--   result.</span><span>
</span><span id="line-876"></span><span class="hs-keyword">data</span><span> </span><span id="TypecheckedModule"><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-var">TypecheckedModule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-877"></span><span>  </span><span id="TypecheckedModule"><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-var">TypecheckedModule</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="tm_parsed_module"><span class="annot"><span class="annottext">TypecheckedModule -&gt; ParsedModule
</span><a href="GHC.html#tm_parsed_module"><span class="hs-identifier hs-var hs-var">tm_parsed_module</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-type">ParsedModule</span></a></span><span>
</span><span id="line-878"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="tm_renamed_source"><span class="annot"><span class="annottext">TypecheckedModule -&gt; Maybe RenamedSource
</span><a href="GHC.html#tm_renamed_source"><span class="hs-identifier hs-var hs-var">tm_renamed_source</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.html#RenamedSource"><span class="hs-identifier hs-type">RenamedSource</span></a></span><span>
</span><span id="line-879"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="tm_typechecked_source"><span class="annot"><span class="annottext">TypecheckedModule -&gt; TypecheckedSource
</span><a href="GHC.html#tm_typechecked_source"><span class="hs-identifier hs-var hs-var">tm_typechecked_source</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedSource"><span class="hs-identifier hs-type">TypecheckedSource</span></a></span><span>
</span><span id="line-880"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="tm_checked_module_info"><span class="annot"><span class="annottext">TypecheckedModule -&gt; ModuleInfo
</span><a href="GHC.html#tm_checked_module_info"><span class="hs-identifier hs-var hs-var">tm_checked_module_info</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span>
</span><span id="line-881"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="tm_internals_"><span class="annot"><span class="annottext">TypecheckedModule -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals_"><span class="hs-identifier hs-var hs-var">tm_internals_</span></a></span></span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModDetails"><span class="hs-identifier hs-type">ModDetails</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-882"></span><span>                    </span><span class="hs-special">}</span><span>
</span><span id="line-883"></span><span>
</span><span id="line-884"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier hs-type">ParsedMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-885"></span><span>  </span><span id="local-6989586621681208592"><span class="annot"><span class="annottext">modSummary :: TypecheckedModule -&gt; ModSummary
</span><a href="#local-6989586621681208592"><span class="hs-identifier hs-var hs-var hs-var hs-var">modSummary</span></a></span></span><span> </span><span id="local-6989586621681208591"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208591"><span class="hs-identifier hs-var">m</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ModSummary
forall m. ParsedMod m =&gt; m -&gt; ModSummary
</span><a href="GHC.html#modSummary"><span class="hs-identifier hs-var">modSummary</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ParsedModule
</span><a href="GHC.html#tm_parsed_module"><span class="hs-identifier hs-var hs-var">tm_parsed_module</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208591"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-886"></span><span>  </span><span id="local-6989586621681208589"><span class="annot"><span class="annottext">parsedSource :: TypecheckedModule -&gt; ParsedSource
</span><a href="#local-6989586621681208589"><span class="hs-identifier hs-var hs-var hs-var hs-var">parsedSource</span></a></span></span><span> </span><span id="local-6989586621681208588"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208588"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ParsedSource
forall m. ParsedMod m =&gt; m -&gt; ParsedSource
</span><a href="GHC.html#parsedSource"><span class="hs-identifier hs-var">parsedSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ParsedModule
</span><a href="GHC.html#tm_parsed_module"><span class="hs-identifier hs-var hs-var">tm_parsed_module</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208588"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-887"></span><span>
</span><span id="line-888"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier hs-type">TypecheckedMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-889"></span><span>  </span><span id="local-6989586621681208579"><span class="annot"><span class="annottext">renamedSource :: TypecheckedModule -&gt; Maybe RenamedSource
</span><a href="#local-6989586621681208579"><span class="hs-identifier hs-var hs-var hs-var hs-var">renamedSource</span></a></span></span><span> </span><span id="local-6989586621681208578"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208578"><span class="hs-identifier hs-var">m</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; Maybe RenamedSource
</span><a href="GHC.html#tm_renamed_source"><span class="hs-identifier hs-var hs-var">tm_renamed_source</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208578"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-890"></span><span>  </span><span id="local-6989586621681208577"><span class="annot"><span class="annottext">typecheckedSource :: TypecheckedModule -&gt; TypecheckedSource
</span><a href="#local-6989586621681208577"><span class="hs-identifier hs-var hs-var hs-var hs-var">typecheckedSource</span></a></span></span><span> </span><span id="local-6989586621681208576"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208576"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; TypecheckedSource
</span><a href="GHC.html#tm_typechecked_source"><span class="hs-identifier hs-var hs-var">tm_typechecked_source</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208576"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-891"></span><span>  </span><span id="local-6989586621681208575"><span class="annot"><span class="annottext">moduleInfo :: TypecheckedModule -&gt; ModuleInfo
</span><a href="#local-6989586621681208575"><span class="hs-identifier hs-var hs-var hs-var hs-var">moduleInfo</span></a></span></span><span> </span><span id="local-6989586621681208574"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208574"><span class="hs-identifier hs-var">m</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ModuleInfo
</span><a href="GHC.html#tm_checked_module_info"><span class="hs-identifier hs-var hs-var">tm_checked_module_info</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208574"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-892"></span><span>  </span><span id="local-6989586621681208573"><span class="annot"><span class="annottext">tm_internals :: TypecheckedModule -&gt; (TcGblEnv, ModDetails)
</span><a href="#local-6989586621681208573"><span class="hs-identifier hs-var hs-var hs-var hs-var">tm_internals</span></a></span></span><span> </span><span id="local-6989586621681208572"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208572"><span class="hs-identifier hs-var">m</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals_"><span class="hs-identifier hs-var hs-var">tm_internals_</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208572"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-893"></span><span>
</span><span id="line-894"></span><span class="hs-comment">-- | The result of successful desugaring (i.e., translation to core).  Also</span><span>
</span><span id="line-895"></span><span class="hs-comment">--  contains all the information of a typechecked module.</span><span>
</span><span id="line-896"></span><span class="hs-keyword">data</span><span> </span><span id="DesugaredModule"><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-var">DesugaredModule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-897"></span><span>  </span><span id="DesugaredModule"><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-var">DesugaredModule</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="dm_typechecked_module"><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span><span>
</span><span id="line-898"></span><span>                  </span><span class="hs-special">,</span><span> </span><span id="dm_core_module"><span class="annot"><span class="annottext">DesugaredModule -&gt; ModGuts
</span><a href="GHC.html#dm_core_module"><span class="hs-identifier hs-var hs-var">dm_core_module</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-899"></span><span>             </span><span class="hs-special">}</span><span>
</span><span id="line-900"></span><span>
</span><span id="line-901"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#ParsedMod"><span class="hs-identifier hs-type">ParsedMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-type">DesugaredModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-902"></span><span>  </span><span id="local-6989586621681208564"><span class="annot"><span class="annottext">modSummary :: DesugaredModule -&gt; ModSummary
</span><a href="#local-6989586621681208564"><span class="hs-identifier hs-var hs-var hs-var hs-var">modSummary</span></a></span></span><span> </span><span id="local-6989586621681208563"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208563"><span class="hs-identifier hs-var">m</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ModSummary
forall m. ParsedMod m =&gt; m -&gt; ModSummary
</span><a href="GHC.html#modSummary"><span class="hs-identifier hs-var">modSummary</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208563"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-903"></span><span>  </span><span id="local-6989586621681208561"><span class="annot"><span class="annottext">parsedSource :: DesugaredModule -&gt; ParsedSource
</span><a href="#local-6989586621681208561"><span class="hs-identifier hs-var hs-var hs-var hs-var">parsedSource</span></a></span></span><span> </span><span id="local-6989586621681208560"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208560"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ParsedSource
forall m. ParsedMod m =&gt; m -&gt; ParsedSource
</span><a href="GHC.html#parsedSource"><span class="hs-identifier hs-var">parsedSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208560"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-904"></span><span>
</span><span id="line-905"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier hs-type">TypecheckedMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-type">DesugaredModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-906"></span><span>  </span><span id="local-6989586621681208551"><span class="annot"><span class="annottext">renamedSource :: DesugaredModule -&gt; Maybe RenamedSource
</span><a href="#local-6989586621681208551"><span class="hs-identifier hs-var hs-var hs-var hs-var">renamedSource</span></a></span></span><span> </span><span id="local-6989586621681208550"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208550"><span class="hs-identifier hs-var">m</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; Maybe RenamedSource
forall m. TypecheckedMod m =&gt; m -&gt; Maybe RenamedSource
</span><a href="GHC.html#renamedSource"><span class="hs-identifier hs-var">renamedSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208550"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-907"></span><span>  </span><span id="local-6989586621681208548"><span class="annot"><span class="annottext">typecheckedSource :: DesugaredModule -&gt; TypecheckedSource
</span><a href="#local-6989586621681208548"><span class="hs-identifier hs-var hs-var hs-var hs-var">typecheckedSource</span></a></span></span><span> </span><span id="local-6989586621681208547"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208547"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; TypecheckedSource
forall m. TypecheckedMod m =&gt; m -&gt; TypecheckedSource
</span><a href="GHC.html#typecheckedSource"><span class="hs-identifier hs-var">typecheckedSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208547"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-908"></span><span>  </span><span id="local-6989586621681208545"><span class="annot"><span class="annottext">moduleInfo :: DesugaredModule -&gt; ModuleInfo
</span><a href="#local-6989586621681208545"><span class="hs-identifier hs-var hs-var hs-var hs-var">moduleInfo</span></a></span></span><span> </span><span id="local-6989586621681208544"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208544"><span class="hs-identifier hs-var">m</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ModuleInfo
forall m. TypecheckedMod m =&gt; m -&gt; ModuleInfo
</span><a href="GHC.html#moduleInfo"><span class="hs-identifier hs-var">moduleInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208544"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-909"></span><span>  </span><span id="local-6989586621681208543"><span class="annot"><span class="annottext">tm_internals :: DesugaredModule -&gt; (TcGblEnv, ModDetails)
</span><a href="#local-6989586621681208543"><span class="hs-identifier hs-var hs-var hs-var hs-var">tm_internals</span></a></span></span><span> </span><span id="local-6989586621681208542"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208542"><span class="hs-identifier hs-var">m</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals_"><span class="hs-identifier hs-var hs-var">tm_internals_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DesugaredModule -&gt; TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var hs-var">dm_typechecked_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208542"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-910"></span><span>
</span><span id="line-911"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.html#DesugaredMod"><span class="hs-identifier hs-type">DesugaredMod</span></a></span><span> </span><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-type">DesugaredModule</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-912"></span><span>  </span><span id="local-6989586621681208536"><span class="annot"><span class="annottext">coreModule :: DesugaredModule -&gt; ModGuts
</span><a href="#local-6989586621681208536"><span class="hs-identifier hs-var hs-var hs-var hs-var">coreModule</span></a></span></span><span> </span><span id="local-6989586621681208535"><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208535"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DesugaredModule -&gt; ModGuts
</span><a href="GHC.html#dm_core_module"><span class="hs-identifier hs-var hs-var">dm_core_module</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule
</span><a href="#local-6989586621681208535"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-913"></span><span>
</span><span id="line-914"></span><span class="hs-keyword">type</span><span> </span><span id="ParsedSource"><span class="annot"><a href="GHC.html#ParsedSource"><span class="hs-identifier hs-var">ParsedSource</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.html#HsModule"><span class="hs-identifier hs-type">HsModule</span></a></span><span>
</span><span id="line-915"></span><span class="hs-keyword">type</span><span> </span><span id="RenamedSource"><span class="annot"><a href="GHC.html#RenamedSource"><span class="hs-identifier hs-var">RenamedSource</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#HsGroup"><span class="hs-identifier hs-type">HsGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LImportDecl"><span class="hs-identifier hs-type">LImportDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#Avails"><span class="hs-identifier hs-type">Avails</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-916"></span><span>                          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Doc.html#LHsDocString"><span class="hs-identifier hs-type">LHsDocString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-917"></span><span class="hs-keyword">type</span><span> </span><span id="TypecheckedSource"><span class="annot"><a href="GHC.html#TypecheckedSource"><span class="hs-identifier hs-var">TypecheckedSource</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span class="hs-comment">-- NOTE:</span><span>
</span><span id="line-920"></span><span class="hs-comment">--   - things that aren't in the output of the typechecker right now:</span><span>
</span><span id="line-921"></span><span class="hs-comment">--     - the export list</span><span>
</span><span id="line-922"></span><span class="hs-comment">--     - the imports</span><span>
</span><span id="line-923"></span><span class="hs-comment">--     - type signatures</span><span>
</span><span id="line-924"></span><span class="hs-comment">--     - type/data/newtype declarations</span><span>
</span><span id="line-925"></span><span class="hs-comment">--     - class declarations</span><span>
</span><span id="line-926"></span><span class="hs-comment">--     - instances</span><span>
</span><span id="line-927"></span><span class="hs-comment">--   - extra things in the typechecker's output:</span><span>
</span><span id="line-928"></span><span class="hs-comment">--     - default methods are turned into top-level decls.</span><span>
</span><span id="line-929"></span><span class="hs-comment">--     - dictionary bindings</span><span>
</span><span id="line-930"></span><span>
</span><span id="line-931"></span><span class="hs-comment">-- | Return the 'ModSummary' of a module with the given name.</span><span>
</span><span id="line-932"></span><span class="hs-comment">--</span><span>
</span><span id="line-933"></span><span class="hs-comment">-- The module must be part of the module graph (see 'hsc_mod_graph' and</span><span>
</span><span id="line-934"></span><span class="hs-comment">-- 'ModuleGraph').  If this is not the case, this function will throw a</span><span>
</span><span id="line-935"></span><span class="hs-comment">-- 'GhcApiError'.</span><span>
</span><span id="line-936"></span><span class="hs-comment">--</span><span>
</span><span id="line-937"></span><span class="hs-comment">-- This function ignores boot modules and requires that there is only one</span><span>
</span><span id="line-938"></span><span class="hs-comment">-- non-boot module with the given name.</span><span>
</span><span id="line-939"></span><span id="local-6989586621681209749"><span class="annot"><a href="GHC.html#getModSummary"><span class="hs-identifier hs-type">getModSummary</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209749"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209749"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span></span><span>
</span><span id="line-940"></span><span id="getModSummary"><span class="annot"><span class="annottext">getModSummary :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m ModSummary
</span><a href="GHC.html#getModSummary"><span class="hs-identifier hs-var hs-var">getModSummary</span></a></span></span><span> </span><span id="local-6989586621681208498"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681208498"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-941"></span><span>   </span><span id="local-6989586621681208497"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681208497"><span class="hs-identifier hs-var">mg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; ModuleGraph) -&gt; m HscEnv -&gt; m ModuleGraph
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#hsc_mod_graph"><span class="hs-identifier hs-var hs-var">hsc_mod_graph</span></a></span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-942"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208495"><span class="annot"><span class="annottext">mods_by_name :: [ModSummary]
</span><a href="#local-6989586621681208495"><span class="hs-identifier hs-var hs-var">mods_by_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208494"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681208494"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208494"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleGraph -&gt; [ModSummary]
</span><a href="GHC.Driver.Types.html#mgModSummaries"><span class="hs-identifier hs-var">mgModSummaries</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681208497"><span class="hs-identifier hs-var">mg</span></a></span><span>
</span><span id="line-943"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier hs-var">ms_mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208494"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681208498"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-944"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; IsBootInterface
</span><a href="GHC.Driver.Types.html#isBootSummary"><span class="hs-identifier hs-var">isBootSummary</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208494"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface -&gt; IsBootInterface -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="GHC.Unit.Types.html#NotBoot"><span class="hs-identifier hs-var">NotBoot</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-945"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681208495"><span class="hs-identifier hs-var">mods_by_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-946"></span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681208491"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208491"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-947"></span><span>              </span><span class="annot"><span class="annottext">IO ModSummary -&gt; m ModSummary
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModSummary -&gt; m ModSummary) -&gt; IO ModSummary -&gt; m ModSummary
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcApiError -&gt; IO ModSummary
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcApiError -&gt; IO ModSummary) -&gt; GhcApiError -&gt; IO ModSummary
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; GhcApiError
</span><a href="GHC.Driver.Types.html#mkApiErr"><span class="hs-identifier hs-var">mkApiErr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208491"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Module not part of module graph&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-948"></span><span>     </span><span class="hs-special">[</span><span id="local-6989586621681208490"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208490"><span class="hs-identifier hs-var">ms</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; m ModSummary
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208490"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-949"></span><span>     </span><span id="local-6989586621681208489"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681208489"><span class="hs-identifier hs-var">multiple</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681208488"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208488"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-950"></span><span>                    </span><span class="annot"><span class="annottext">IO ModSummary -&gt; m ModSummary
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModSummary -&gt; m ModSummary) -&gt; IO ModSummary -&gt; m ModSummary
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcApiError -&gt; IO ModSummary
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcApiError -&gt; IO ModSummary) -&gt; GhcApiError -&gt; IO ModSummary
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; GhcApiError
</span><a href="GHC.Driver.Types.html#mkApiErr"><span class="hs-identifier hs-var">mkApiErr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681208488"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;getModSummary is ambiguous: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681208489"><span class="hs-identifier hs-var">multiple</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-951"></span><span>
</span><span id="line-952"></span><span class="hs-comment">-- | Parse a module.</span><span>
</span><span id="line-953"></span><span class="hs-comment">--</span><span>
</span><span id="line-954"></span><span class="hs-comment">-- Throws a 'SourceError' on parse error.</span><span>
</span><span id="line-955"></span><span id="local-6989586621681209741"><span class="annot"><a href="GHC.html#parseModule"><span class="hs-identifier hs-type">parseModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209741"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209741"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-type">ParsedModule</span></a></span></span><span>
</span><span id="line-956"></span><span id="parseModule"><span class="annot"><span class="annottext">parseModule :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m ParsedModule
</span><a href="GHC.html#parseModule"><span class="hs-identifier hs-var hs-var">parseModule</span></a></span></span><span> </span><span id="local-6989586621681208475"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208475"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-957"></span><span>   </span><span id="local-6989586621681208474"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208474"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-958"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208473"><span class="annot"><span class="annottext">hsc_env_tmp :: HscEnv
</span><a href="#local-6989586621681208473"><span class="hs-identifier hs-var hs-var">hsc_env_tmp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208474"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var hs-var">ms_hspp_opts</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208475"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-959"></span><span>   </span><span id="local-6989586621681208471"><span class="annot"><span class="annottext">HsParsedModule
</span><a href="#local-6989586621681208471"><span class="hs-identifier hs-var">hpm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO HsParsedModule -&gt; m HsParsedModule
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HsParsedModule -&gt; m HsParsedModule)
-&gt; IO HsParsedModule -&gt; m HsParsedModule
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModSummary -&gt; IO HsParsedModule
</span><a href="GHC.Driver.Main.html#hscParse"><span class="hs-identifier hs-var">hscParse</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208473"><span class="hs-identifier hs-var">hsc_env_tmp</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208475"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-960"></span><span>   </span><span class="annot"><span class="annottext">ParsedModule -&gt; m ParsedModule
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; ParsedSource -&gt; [FilePath] -&gt; ApiAnns -&gt; ParsedModule
</span><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-var">ParsedModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208475"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsParsedModule -&gt; ParsedSource
</span><a href="GHC.Driver.Types.html#hpm_module"><span class="hs-identifier hs-var hs-var">hpm_module</span></a></span><span> </span><span class="annot"><span class="annottext">HsParsedModule
</span><a href="#local-6989586621681208471"><span class="hs-identifier hs-var">hpm</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsParsedModule -&gt; [FilePath]
</span><a href="GHC.Driver.Types.html#hpm_src_files"><span class="hs-identifier hs-var hs-var">hpm_src_files</span></a></span><span> </span><span class="annot"><span class="annottext">HsParsedModule
</span><a href="#local-6989586621681208471"><span class="hs-identifier hs-var">hpm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-961"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsParsedModule -&gt; ApiAnns
</span><a href="GHC.Driver.Types.html#hpm_annotations"><span class="hs-identifier hs-var hs-var">hpm_annotations</span></a></span><span> </span><span class="annot"><span class="annottext">HsParsedModule
</span><a href="#local-6989586621681208471"><span class="hs-identifier hs-var">hpm</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-962"></span><span>               </span><span class="hs-comment">-- See Note [Api annotations] in GHC.Parser.Annotation</span><span>
</span><span id="line-963"></span><span>
</span><span id="line-964"></span><span class="hs-comment">-- | Typecheck and rename a parsed module.</span><span>
</span><span id="line-965"></span><span class="hs-comment">--</span><span>
</span><span id="line-966"></span><span class="hs-comment">-- Throws a 'SourceError' if either fails.</span><span>
</span><span id="line-967"></span><span id="local-6989586621681209738"><span class="annot"><a href="GHC.html#typecheckModule"><span class="hs-identifier hs-type">typecheckModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209738"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.html#ParsedModule"><span class="hs-identifier hs-type">ParsedModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209738"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span></span><span>
</span><span id="line-968"></span><span id="typecheckModule"><span class="annot"><span class="annottext">typecheckModule :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
ParsedModule -&gt; m TypecheckedModule
</span><a href="GHC.html#typecheckModule"><span class="hs-identifier hs-var hs-var">typecheckModule</span></a></span></span><span> </span><span id="local-6989586621681208449"><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-969"></span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208448"><span class="annot"><span class="annottext">ms :: ModSummary
</span><a href="#local-6989586621681208448"><span class="hs-identifier hs-var hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ModSummary
forall m. ParsedMod m =&gt; m -&gt; ModSummary
</span><a href="GHC.html#modSummary"><span class="hs-identifier hs-var">modSummary</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span><span>
</span><span id="line-970"></span><span> </span><span id="local-6989586621681208447"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208447"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-971"></span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208446"><span class="annot"><span class="annottext">hsc_env_tmp :: HscEnv
</span><a href="#local-6989586621681208446"><span class="hs-identifier hs-var hs-var">hsc_env_tmp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208447"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var hs-var">ms_hspp_opts</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208448"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-972"></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208445"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208444"><span class="annot"><span class="annottext">Maybe RenamedSource
</span><a href="#local-6989586621681208444"><span class="hs-identifier hs-var">rn_info</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-973"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (TcGblEnv, Maybe RenamedSource)
-&gt; m (TcGblEnv, Maybe RenamedSource)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (TcGblEnv, Maybe RenamedSource)
 -&gt; m (TcGblEnv, Maybe RenamedSource))
-&gt; IO (TcGblEnv, Maybe RenamedSource)
-&gt; m (TcGblEnv, Maybe RenamedSource)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; ModSummary
-&gt; HsParsedModule
-&gt; IO (TcGblEnv, Maybe RenamedSource)
</span><a href="GHC.Driver.Main.html#hscTypecheckRename"><span class="hs-identifier hs-var">hscTypecheckRename</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208446"><span class="hs-identifier hs-var">hsc_env_tmp</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208448"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">(HsParsedModule -&gt; IO (TcGblEnv, Maybe RenamedSource))
-&gt; HsParsedModule -&gt; IO (TcGblEnv, Maybe RenamedSource)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-974"></span><span>                      </span><span class="annot"><span class="annottext">HsParsedModule :: ParsedSource -&gt; [FilePath] -&gt; ApiAnns -&gt; HsParsedModule
</span><a href="GHC.Driver.Types.html#HsParsedModule"><span class="hs-identifier hs-type">HsParsedModule</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hpm_module :: ParsedSource
</span><a href="GHC.Driver.Types.html#hpm_module"><span class="hs-identifier hs-var">hpm_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ParsedSource
forall m. ParsedMod m =&gt; m -&gt; ParsedSource
</span><a href="GHC.html#parsedSource"><span class="hs-identifier hs-var">parsedSource</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-975"></span><span>                                       </span><span class="annot"><span class="annottext">hpm_src_files :: [FilePath]
</span><a href="GHC.Driver.Types.html#hpm_src_files"><span class="hs-identifier hs-var">hpm_src_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; [FilePath]
</span><a href="GHC.html#pm_extra_src_files"><span class="hs-identifier hs-var hs-var">pm_extra_src_files</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-976"></span><span>                                       </span><span class="annot"><span class="annottext">hpm_annotations :: ApiAnns
</span><a href="GHC.Driver.Types.html#hpm_annotations"><span class="hs-identifier hs-var">hpm_annotations</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; ApiAnns
</span><a href="GHC.html#pm_annotations"><span class="hs-identifier hs-var hs-var">pm_annotations</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-977"></span><span> </span><span id="local-6989586621681208441"><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208441"><span class="hs-identifier hs-var">details</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModDetails -&gt; m ModDetails
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModDetails -&gt; m ModDetails) -&gt; IO ModDetails -&gt; m ModDetails
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TcGblEnv -&gt; IO ModDetails
</span><a href="GHC.Driver.Main.html#makeSimpleDetails"><span class="hs-identifier hs-var">makeSimpleDetails</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208446"><span class="hs-identifier hs-var">hsc_env_tmp</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span><span>
</span><span id="line-978"></span><span> </span><span id="local-6989586621681208439"><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208439"><span class="hs-keyword hs-var">safe</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO SafeHaskellMode -&gt; m SafeHaskellMode
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO SafeHaskellMode -&gt; m SafeHaskellMode)
-&gt; IO SafeHaskellMode -&gt; m SafeHaskellMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; TcGblEnv -&gt; IO SafeHaskellMode
</span><a href="GHC.Tc.Utils.Monad.html#finalSafeMode"><span class="hs-identifier hs-var">finalSafeMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var hs-var">ms_hspp_opts</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208448"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span><span>
</span><span id="line-979"></span><span>
</span><span id="line-980"></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; m TypecheckedModule
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(TypecheckedModule -&gt; m TypecheckedModule)
-&gt; TypecheckedModule -&gt; m TypecheckedModule
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-981"></span><span>     </span><span class="annot"><span class="annottext">TypecheckedModule :: ParsedModule
-&gt; Maybe RenamedSource
-&gt; TypecheckedSource
-&gt; ModuleInfo
-&gt; (TcGblEnv, ModDetails)
-&gt; TypecheckedModule
</span><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-982"></span><span>       </span><span class="annot"><span class="annottext">tm_internals_ :: (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals_"><span class="hs-identifier hs-var">tm_internals_</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208441"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-983"></span><span>       </span><span class="annot"><span class="annottext">tm_parsed_module :: ParsedModule
</span><a href="GHC.html#tm_parsed_module"><span class="hs-identifier hs-var">tm_parsed_module</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681208449"><span class="hs-identifier hs-var">pmod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-984"></span><span>       </span><span class="annot"><span class="annottext">tm_renamed_source :: Maybe RenamedSource
</span><a href="GHC.html#tm_renamed_source"><span class="hs-identifier hs-var">tm_renamed_source</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe RenamedSource
</span><a href="#local-6989586621681208444"><span class="hs-identifier hs-var">rn_info</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-985"></span><span>       </span><span class="annot"><span class="annottext">tm_typechecked_source :: TypecheckedSource
</span><a href="GHC.html#tm_typechecked_source"><span class="hs-identifier hs-var">tm_typechecked_source</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; TypecheckedSource
</span><a href="GHC.Tc.Types.html#tcg_binds"><span class="hs-identifier hs-var hs-var">tcg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-986"></span><span>       </span><span class="annot"><span class="annottext">tm_checked_module_info :: ModuleInfo
</span><a href="GHC.html#tm_checked_module_info"><span class="hs-identifier hs-var">tm_checked_module_info</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-987"></span><span>         </span><span class="annot"><span class="annottext">ModuleInfo :: TypeEnv
-&gt; [AvailInfo]
-&gt; Maybe GlobalRdrEnv
-&gt; [ClsInst]
-&gt; Maybe ModIface
-&gt; SafeHaskellMode
-&gt; ModBreaks
-&gt; ModuleInfo
</span><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-988"></span><span>           </span><span class="annot"><span class="annottext">minf_type_env :: TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var">minf_type_env</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#md_types"><span class="hs-identifier hs-var hs-var">md_types</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208441"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-989"></span><span>           </span><span class="annot"><span class="annottext">minf_exports :: [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var">minf_exports</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; [AvailInfo]
</span><a href="GHC.Driver.Types.html#md_exports"><span class="hs-identifier hs-var hs-var">md_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208441"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-990"></span><span>           </span><span class="annot"><span class="annottext">minf_rdr_env :: Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var">minf_rdr_env</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Maybe GlobalRdrEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; GlobalRdrEnv
</span><a href="GHC.Tc.Types.html#tcg_rdr_env"><span class="hs-identifier hs-var hs-var">tcg_rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208445"><span class="hs-identifier hs-var">tc_gbl_env</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-991"></span><span>           </span><span class="annot"><span class="annottext">minf_instances :: [ClsInst]
</span><a href="GHC.html#minf_instances"><span class="hs-identifier hs-var">minf_instances</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode -&gt; [ClsInst] -&gt; [ClsInst]
</span><a href="GHC.Tc.Utils.Monad.html#fixSafeInstances"><span class="hs-identifier hs-var">fixSafeInstances</span></a></span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208439"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">([ClsInst] -&gt; [ClsInst]) -&gt; [ClsInst] -&gt; [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; [ClsInst]
</span><a href="GHC.Driver.Types.html#md_insts"><span class="hs-identifier hs-var hs-var">md_insts</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208441"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-992"></span><span>           </span><span class="annot"><span class="annottext">minf_iface :: Maybe ModIface
</span><a href="GHC.html#minf_iface"><span class="hs-identifier hs-var">minf_iface</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ModIface
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-993"></span><span>           </span><span class="annot"><span class="annottext">minf_safe :: SafeHaskellMode
</span><a href="GHC.html#minf_safe"><span class="hs-identifier hs-var">minf_safe</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208439"><span class="hs-keyword hs-var">safe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-994"></span><span>           </span><span class="annot"><span class="annottext">minf_modBreaks :: ModBreaks
</span><a href="GHC.html#minf_modBreaks"><span class="hs-identifier hs-var">minf_modBreaks</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="GHC.ByteCode.Types.html#emptyModBreaks"><span class="hs-identifier hs-var">emptyModBreaks</span></a></span><span>
</span><span id="line-995"></span><span>         </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-996"></span><span>
</span><span id="line-997"></span><span class="hs-comment">-- | Desugar a typechecked module.</span><span>
</span><span id="line-998"></span><span id="local-6989586621681209729"><span class="annot"><a href="GHC.html#desugarModule"><span class="hs-identifier hs-type">desugarModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209729"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.html#TypecheckedModule"><span class="hs-identifier hs-type">TypecheckedModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209729"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-type">DesugaredModule</span></a></span></span><span>
</span><span id="line-999"></span><span id="desugarModule"><span class="annot"><span class="annottext">desugarModule :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
TypecheckedModule -&gt; m DesugaredModule
</span><a href="GHC.html#desugarModule"><span class="hs-identifier hs-var hs-var">desugarModule</span></a></span></span><span> </span><span id="local-6989586621681208411"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208411"><span class="hs-identifier hs-var">tcm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1000"></span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208410"><span class="annot"><span class="annottext">ms :: ModSummary
</span><a href="#local-6989586621681208410"><span class="hs-identifier hs-var hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; ModSummary
forall m. ParsedMod m =&gt; m -&gt; ModSummary
</span><a href="GHC.html#modSummary"><span class="hs-identifier hs-var">modSummary</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208411"><span class="hs-identifier hs-var">tcm</span></a></span><span>
</span><span id="line-1001"></span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208409"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208409"><span class="hs-identifier hs-var">tcg</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; (TcGblEnv, ModDetails)
forall m. TypecheckedMod m =&gt; m -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals"><span class="hs-identifier hs-var">tm_internals</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208411"><span class="hs-identifier hs-var">tcm</span></a></span><span>
</span><span id="line-1002"></span><span> </span><span id="local-6989586621681208408"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208408"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1003"></span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208407"><span class="annot"><span class="annottext">hsc_env_tmp :: HscEnv
</span><a href="#local-6989586621681208407"><span class="hs-identifier hs-var hs-var">hsc_env_tmp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208408"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var hs-var">ms_hspp_opts</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208410"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1004"></span><span> </span><span id="local-6989586621681208406"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208406"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModGuts -&gt; m ModGuts
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModGuts -&gt; m ModGuts) -&gt; IO ModGuts -&gt; m ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModSummary -&gt; TcGblEnv -&gt; IO ModGuts
</span><a href="GHC.Driver.Main.html#hscDesugar"><span class="hs-identifier hs-var">hscDesugar</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208407"><span class="hs-identifier hs-var">hsc_env_tmp</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208410"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208409"><span class="hs-identifier hs-var">tcg</span></a></span><span>
</span><span id="line-1005"></span><span> </span><span class="annot"><span class="annottext">DesugaredModule -&gt; m DesugaredModule
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(DesugaredModule -&gt; m DesugaredModule)
-&gt; DesugaredModule -&gt; m DesugaredModule
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1006"></span><span>     </span><span class="annot"><span class="annottext">DesugaredModule :: TypecheckedModule -&gt; ModGuts -&gt; DesugaredModule
</span><a href="GHC.html#DesugaredModule"><span class="hs-identifier hs-type">DesugaredModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1007"></span><span>       </span><span class="annot"><span class="annottext">dm_typechecked_module :: TypecheckedModule
</span><a href="GHC.html#dm_typechecked_module"><span class="hs-identifier hs-var">dm_typechecked_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208411"><span class="hs-identifier hs-var">tcm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1008"></span><span>       </span><span class="annot"><span class="annottext">dm_core_module :: ModGuts
</span><a href="GHC.html#dm_core_module"><span class="hs-identifier hs-var">dm_core_module</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208406"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-1009"></span><span>     </span><span class="hs-special">}</span><span>
</span><span id="line-1010"></span><span>
</span><span id="line-1011"></span><span class="hs-comment">-- | Load a module.  Input doesn't need to be desugared.</span><span>
</span><span id="line-1012"></span><span class="hs-comment">--</span><span>
</span><span id="line-1013"></span><span class="hs-comment">-- A module must be loaded before dependent modules can be typechecked.  This</span><span>
</span><span id="line-1014"></span><span class="hs-comment">-- always includes generating a 'ModIface' and, depending on the</span><span>
</span><span id="line-1015"></span><span class="hs-comment">-- @DynFlags@\'s 'GHC.Driver.Session.hscTarget', may also include code generation.</span><span>
</span><span id="line-1016"></span><span class="hs-comment">--</span><span>
</span><span id="line-1017"></span><span class="hs-comment">-- This function will always cause recompilation and will always overwrite</span><span>
</span><span id="line-1018"></span><span class="hs-comment">-- previous compilation results (potentially files on disk).</span><span>
</span><span id="line-1019"></span><span class="hs-comment">--</span><span>
</span><span id="line-1020"></span><span id="local-6989586621681209726"><span id="local-6989586621681209727"><span class="annot"><a href="GHC.html#loadModule"><span class="hs-identifier hs-type">loadModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.html#TypecheckedMod"><span class="hs-identifier hs-type">TypecheckedMod</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209727"><span class="hs-identifier hs-type">mod</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209726"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209727"><span class="hs-identifier hs-type">mod</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209727"><span class="hs-identifier hs-type">mod</span></a></span></span></span><span>
</span><span id="line-1021"></span><span id="loadModule"><span class="annot"><span class="annottext">loadModule :: forall mod (m :: * -&gt; *).
(TypecheckedMod mod, GhcMonad m) =&gt;
mod -&gt; m mod
</span><a href="GHC.html#loadModule"><span class="hs-identifier hs-var hs-var">loadModule</span></a></span></span><span> </span><span id="local-6989586621681208380"><span class="annot"><span class="annottext">mod
</span><a href="#local-6989586621681208380"><span class="hs-identifier hs-var">tcm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1022"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208379"><span class="annot"><span class="annottext">ms :: ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">mod -&gt; ModSummary
forall m. ParsedMod m =&gt; m -&gt; ModSummary
</span><a href="GHC.html#modSummary"><span class="hs-identifier hs-var">modSummary</span></a></span><span> </span><span class="annot"><span class="annottext">mod
</span><a href="#local-6989586621681208380"><span class="hs-identifier hs-var">tcm</span></a></span><span>
</span><span id="line-1023"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208378"><span class="annot"><span class="annottext">mod :: ModuleName
</span><a href="#local-6989586621681208378"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier hs-var">ms_mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-1024"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208377"><span class="annot"><span class="annottext">loc :: ModLocation
</span><a href="#local-6989586621681208377"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; ModLocation
</span><a href="GHC.Driver.Types.html#ms_location"><span class="hs-identifier hs-var hs-var">ms_location</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-1025"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208375"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208375"><span class="hs-identifier hs-var">tcg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208374"><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208374"><span class="hs-identifier hs-var">_details</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">mod -&gt; (TcGblEnv, ModDetails)
forall m. TypecheckedMod m =&gt; m -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals"><span class="hs-identifier hs-var">tm_internals</span></a></span><span> </span><span class="annot"><span class="annottext">mod
</span><a href="#local-6989586621681208380"><span class="hs-identifier hs-var">tcm</span></a></span><span>
</span><span id="line-1026"></span><span>
</span><span id="line-1027"></span><span>   </span><span id="local-6989586621681208373"><span class="annot"><span class="annottext">Maybe Linkable
</span><a href="#local-6989586621681208373"><span class="hs-identifier hs-var">mb_linkable</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_obj_date"><span class="hs-identifier hs-var hs-var">ms_obj_date</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1028"></span><span>                     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208371"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681208371"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681208371"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime -&gt; UTCTime -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; UTCTime
</span><a href="GHC.Driver.Types.html#ms_hs_date"><span class="hs-identifier hs-var hs-var">ms_hs_date</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1029"></span><span>                         </span><span id="local-6989586621681208369"><span class="annot"><span class="annottext">Linkable
</span><a href="#local-6989586621681208369"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Linkable -&gt; m Linkable
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Linkable -&gt; m Linkable) -&gt; IO Linkable -&gt; m Linkable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; FilePath -&gt; UTCTime -&gt; IO Linkable
</span><a href="GHC.Driver.Finder.html#findObjectLinkable"><span class="hs-identifier hs-var">findObjectLinkable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var hs-var">ms_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1030"></span><span>                                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_obj_file"><span class="hs-identifier hs-var hs-var">ml_obj_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681208377"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681208371"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1031"></span><span>                         </span><span class="annot"><span class="annottext">Maybe Linkable -&gt; m (Maybe Linkable)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Linkable -&gt; Maybe Linkable
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Linkable
</span><a href="#local-6989586621681208369"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>                     </span><span id="local-6989586621681208365"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681208365"><span class="hs-identifier hs-var">_otherwise</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Linkable -&gt; m (Maybe Linkable)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Linkable
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1033"></span><span>
</span><span id="line-1034"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208364"><span class="annot"><span class="annottext">source_modified :: SourceModified
</span><a href="#local-6989586621681208364"><span class="hs-identifier hs-var hs-var">source_modified</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe Linkable -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Linkable
</span><a href="#local-6989586621681208373"><span class="hs-identifier hs-var">mb_linkable</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceModified
</span><a href="GHC.Driver.Types.html#SourceModified"><span class="hs-identifier hs-var">SourceModified</span></a></span><span>
</span><span id="line-1035"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceModified
</span><a href="GHC.Driver.Types.html#SourceUnmodified"><span class="hs-identifier hs-var">SourceUnmodified</span></a></span><span>
</span><span id="line-1036"></span><span>                       </span><span class="hs-comment">-- we can't determine stability here</span><span>
</span><span id="line-1037"></span><span>
</span><span id="line-1038"></span><span>   </span><span class="hs-comment">-- compile doesn't change the session</span><span>
</span><span id="line-1039"></span><span>   </span><span id="local-6989586621681208360"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208360"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1040"></span><span>   </span><span id="local-6989586621681208359"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208359"><span class="hs-identifier hs-var">mod_info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO HomeModInfo -&gt; m HomeModInfo
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HomeModInfo -&gt; m HomeModInfo)
-&gt; IO HomeModInfo -&gt; m HomeModInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TcGblEnv
-&gt; Maybe Messager
-&gt; HscEnv
-&gt; ModSummary
-&gt; Int
-&gt; Int
-&gt; Maybe ModIface
-&gt; Maybe Linkable
-&gt; SourceModified
-&gt; IO HomeModInfo
</span><a href="GHC.Driver.Pipeline.html#compileOne%27"><span class="hs-identifier hs-var">compileOne'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; Maybe TcGblEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208375"><span class="hs-identifier hs-var">tcg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Messager
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1041"></span><span>                                    </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208360"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208379"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Maybe ModIface
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Linkable
</span><a href="#local-6989586621681208373"><span class="hs-identifier hs-var">mb_linkable</span></a></span><span>
</span><span id="line-1042"></span><span>                                    </span><span class="annot"><span class="annottext">SourceModified
</span><a href="#local-6989586621681208364"><span class="hs-identifier hs-var">source_modified</span></a></span><span>
</span><span id="line-1043"></span><span>
</span><span id="line-1044"></span><span>   </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208358"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208358"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208358"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_HPT :: HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var">hsc_HPT</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; HomeModInfo -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#addToHpt"><span class="hs-identifier hs-var">addToHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208358"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681208378"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208359"><span class="hs-identifier hs-var">mod_info</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1045"></span><span>   </span><span class="annot"><span class="annottext">mod -&gt; m mod
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">mod
</span><a href="#local-6989586621681208380"><span class="hs-identifier hs-var">tcm</span></a></span><span>
</span><span id="line-1046"></span><span>
</span><span id="line-1047"></span><span>
</span><span id="line-1048"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-1049"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-1050"></span><span class="hs-comment">--             Dealing with Core</span><span>
</span><span id="line-1051"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-1052"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-1053"></span><span>
</span><span id="line-1054"></span><span class="hs-comment">-- | A CoreModule consists of just the fields of a 'ModGuts' that are needed for</span><span>
</span><span id="line-1055"></span><span class="hs-comment">-- the 'GHC.compileToCoreModule' interface.</span><span>
</span><span id="line-1056"></span><span class="hs-keyword">data</span><span> </span><span id="CoreModule"><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-var">CoreModule</span></a></span></span><span>
</span><span id="line-1057"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="CoreModule"><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-var">CoreModule</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1058"></span><span>      </span><span class="hs-comment">-- | Module name</span><span>
</span><span id="line-1059"></span><span>      </span><span id="cm_module"><span class="annot"><span class="annottext">CoreModule -&gt; Module
</span><a href="GHC.html#cm_module"><span class="hs-identifier hs-var hs-var">cm_module</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1060"></span><span>      </span><span class="hs-comment">-- | Type environment for types declared in this module</span><span>
</span><span id="line-1061"></span><span>      </span><span id="cm_types"><span class="annot"><span class="annottext">CoreModule -&gt; TypeEnv
</span><a href="GHC.html#cm_types"><span class="hs-identifier hs-var hs-var">cm_types</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Driver.Types.html#TypeEnv"><span class="hs-identifier hs-type">TypeEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1062"></span><span>      </span><span class="hs-comment">-- | Declarations</span><span>
</span><span id="line-1063"></span><span>      </span><span id="cm_binds"><span class="annot"><span class="annottext">CoreModule -&gt; CoreProgram
</span><a href="GHC.html#cm_binds"><span class="hs-identifier hs-var hs-var">cm_binds</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1064"></span><span>      </span><span class="hs-comment">-- | Safe Haskell mode</span><span>
</span><span id="line-1065"></span><span>      </span><span id="cm_safe"><span class="annot"><span class="annottext">CoreModule -&gt; SafeHaskellMode
</span><a href="GHC.html#cm_safe"><span class="hs-identifier hs-var hs-var">cm_safe</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#SafeHaskellMode"><span class="hs-identifier hs-type">SafeHaskellMode</span></a></span><span>
</span><span id="line-1066"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1067"></span><span>
</span><span id="line-1068"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681208348"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1069"></span><span>   </span><span id="local-6989586621681208334"><span class="annot"><span class="annottext">ppr :: CoreModule -&gt; SDoc
</span><a href="#local-6989586621681208334"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cm_module :: CoreModule -&gt; Module
</span><a href="GHC.html#cm_module"><span class="hs-identifier hs-var">cm_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681208333"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208333"><span class="hs-identifier hs-var">mn</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cm_types :: CoreModule -&gt; TypeEnv
</span><a href="GHC.html#cm_types"><span class="hs-identifier hs-var">cm_types</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681208332"><span class="annot"><span class="annottext">TypeEnv
</span><a href="#local-6989586621681208332"><span class="hs-identifier hs-var">te</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cm_binds :: CoreModule -&gt; CoreProgram
</span><a href="GHC.html#cm_binds"><span class="hs-identifier hs-var">cm_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681208331"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681208331"><span class="hs-identifier hs-var">cb</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-1070"></span><span>                    </span><span class="annot"><span class="annottext">cm_safe :: CoreModule -&gt; SafeHaskellMode
</span><a href="GHC.html#cm_safe"><span class="hs-identifier hs-var">cm_safe</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681208330"><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208330"><span class="hs-identifier hs-var">sf</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1071"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;%module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208333"><span class="hs-identifier hs-var">mn</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SafeHaskellMode -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208330"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TypeEnv -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TypeEnv
</span><a href="#local-6989586621681208332"><span class="hs-identifier hs-var">te</span></a></span><span>
</span><span id="line-1072"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreBind -&gt; SDoc) -&gt; CoreProgram -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681208331"><span class="hs-identifier hs-var">cb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1073"></span><span>
</span><span id="line-1074"></span><span class="hs-comment">-- | This is the way to get access to the Core bindings corresponding</span><span>
</span><span id="line-1075"></span><span class="hs-comment">-- to a module. 'compileToCore' parses, typechecks, and</span><span>
</span><span id="line-1076"></span><span class="hs-comment">-- desugars the module, then returns the resulting Core module (consisting of</span><span>
</span><span id="line-1077"></span><span class="hs-comment">-- the module name, type declarations, and function declarations) if</span><span>
</span><span id="line-1078"></span><span class="hs-comment">-- successful.</span><span>
</span><span id="line-1079"></span><span id="local-6989586621681209705"><span class="annot"><a href="GHC.html#compileToCoreModule"><span class="hs-identifier hs-type">compileToCoreModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209705"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209705"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span></span><span>
</span><span id="line-1080"></span><span id="compileToCoreModule"><span class="annot"><span class="annottext">compileToCoreModule :: forall (m :: * -&gt; *). GhcMonad m =&gt; FilePath -&gt; m CoreModule
</span><a href="GHC.html#compileToCoreModule"><span class="hs-identifier hs-var hs-var">compileToCoreModule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; FilePath -&gt; m CoreModule
forall (m :: * -&gt; *).
GhcMonad m =&gt;
Bool -&gt; FilePath -&gt; m CoreModule
</span><a href="GHC.html#compileCore"><span class="hs-identifier hs-var">compileCore</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1081"></span><span>
</span><span id="line-1082"></span><span class="hs-comment">-- | Like compileToCoreModule, but invokes the simplifier, so</span><span>
</span><span id="line-1083"></span><span class="hs-comment">-- as to return simplified and tidied Core.</span><span>
</span><span id="line-1084"></span><span id="local-6989586621681208323"><span class="annot"><a href="GHC.html#compileToCoreSimplified"><span class="hs-identifier hs-type">compileToCoreSimplified</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681208323"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681208323"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span></span><span>
</span><span id="line-1085"></span><span id="compileToCoreSimplified"><span class="annot"><span class="annottext">compileToCoreSimplified :: forall (m :: * -&gt; *). GhcMonad m =&gt; FilePath -&gt; m CoreModule
</span><a href="GHC.html#compileToCoreSimplified"><span class="hs-identifier hs-var hs-var">compileToCoreSimplified</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; FilePath -&gt; m CoreModule
forall (m :: * -&gt; *).
GhcMonad m =&gt;
Bool -&gt; FilePath -&gt; m CoreModule
</span><a href="GHC.html#compileCore"><span class="hs-identifier hs-var">compileCore</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1086"></span><span>
</span><span id="line-1087"></span><span id="local-6989586621681209703"><span class="annot"><a href="GHC.html#compileCore"><span class="hs-identifier hs-type">compileCore</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209703"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209703"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span></span><span>
</span><span id="line-1088"></span><span id="compileCore"><span class="annot"><span class="annottext">compileCore :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Bool -&gt; FilePath -&gt; m CoreModule
</span><a href="GHC.html#compileCore"><span class="hs-identifier hs-var hs-var">compileCore</span></a></span></span><span> </span><span id="local-6989586621681208284"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208284"><span class="hs-identifier hs-var">simplify</span></a></span></span><span> </span><span id="local-6989586621681208283"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208283"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1089"></span><span>   </span><span class="hs-comment">-- First, set the target to the desired filename</span><span>
</span><span id="line-1090"></span><span>   </span><span id="local-6989586621681208282"><span class="annot"><span class="annottext">Target
</span><a href="#local-6989586621681208282"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; m Target
forall (m :: * -&gt; *).
GhcMonad m =&gt;
FilePath -&gt; Maybe Phase -&gt; m Target
</span><a href="GHC.html#guessTarget"><span class="hs-identifier hs-var">guessTarget</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208283"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1091"></span><span>   </span><span class="annot"><span class="annottext">Target -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; Target -&gt; m ()
</span><a href="GHC.html#addTarget"><span class="hs-identifier hs-var">addTarget</span></a></span><span> </span><span class="annot"><span class="annottext">Target
</span><a href="#local-6989586621681208282"><span class="hs-identifier hs-var">target</span></a></span><span>
</span><span id="line-1092"></span><span>   </span><span class="annot"><span class="annottext">SuccessFlag
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LoadHowMuch -&gt; m SuccessFlag
forall (m :: * -&gt; *). GhcMonad m =&gt; LoadHowMuch -&gt; m SuccessFlag
</span><a href="GHC.Driver.Make.html#load"><span class="hs-identifier hs-var">load</span></a></span><span> </span><span class="annot"><span class="annottext">LoadHowMuch
</span><a href="GHC.Driver.Make.html#LoadAllTargets"><span class="hs-identifier hs-var">LoadAllTargets</span></a></span><span>
</span><span id="line-1093"></span><span>   </span><span class="hs-comment">-- Then find dependencies</span><span>
</span><span id="line-1094"></span><span>   </span><span id="local-6989586621681208280"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681208280"><span class="hs-identifier hs-var">modGraph</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ModuleName] -&gt; Bool -&gt; m ModuleGraph
forall (m :: * -&gt; *).
GhcMonad m =&gt;
[ModuleName] -&gt; Bool -&gt; m ModuleGraph
</span><a href="GHC.Driver.Make.html#depanal"><span class="hs-identifier hs-var">depanal</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1095"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; Bool) -&gt; [ModSummary] -&gt; Maybe ModSummary
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681208283"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; Bool)
-&gt; (ModSummary -&gt; FilePath) -&gt; ModSummary -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#msHsFilePath"><span class="hs-identifier hs-var">msHsFilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleGraph -&gt; [ModSummary]
</span><a href="GHC.Driver.Types.html#mgModSummaries"><span class="hs-identifier hs-var">mgModSummaries</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681208280"><span class="hs-identifier hs-var">modGraph</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1096"></span><span>     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208277"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208277"><span class="hs-identifier hs-var">modSummary</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1097"></span><span>       </span><span class="hs-comment">-- Now we have the module name;</span><span>
</span><span id="line-1098"></span><span>       </span><span class="hs-comment">-- parse, typecheck and desugar the module</span><span>
</span><span id="line-1099"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681208276"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208276"><span class="hs-identifier hs-var">tcg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208275"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208275"><span class="hs-identifier hs-var">mod_guts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-comment">-- TODO: space leaky: call hsc* directly?</span><span>
</span><span id="line-1100"></span><span>         </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681208274"><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208274"><span class="hs-identifier hs-var">tm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsedModule -&gt; m TypecheckedModule
forall (m :: * -&gt; *).
GhcMonad m =&gt;
ParsedModule -&gt; m TypecheckedModule
</span><a href="GHC.html#typecheckModule"><span class="hs-identifier hs-var">typecheckModule</span></a></span><span> </span><span class="annot"><span class="annottext">(ParsedModule -&gt; m TypecheckedModule)
-&gt; m ParsedModule -&gt; m TypecheckedModule
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; m ParsedModule
forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m ParsedModule
</span><a href="GHC.html#parseModule"><span class="hs-identifier hs-var">parseModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681208277"><span class="hs-identifier hs-var">modSummary</span></a></span><span>
</span><span id="line-1101"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208272"><span class="annot"><span class="annottext">tcg :: TcGblEnv
</span><a href="#local-6989586621681208272"><span class="hs-identifier hs-var hs-var">tcg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcGblEnv, ModDetails) -&gt; TcGblEnv
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TypecheckedModule -&gt; (TcGblEnv, ModDetails)
forall m. TypecheckedMod m =&gt; m -&gt; (TcGblEnv, ModDetails)
</span><a href="GHC.html#tm_internals"><span class="hs-identifier hs-var">tm_internals</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208274"><span class="hs-identifier hs-var">tm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1102"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208272"><span class="hs-identifier hs-var">tcg</span></a></span><span> </span><span class="annot"><span class="annottext">(ModGuts -&gt; (TcGblEnv, ModGuts))
-&gt; (DesugaredModule -&gt; ModGuts)
-&gt; DesugaredModule
-&gt; (TcGblEnv, ModGuts)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DesugaredModule -&gt; ModGuts
forall m. DesugaredMod m =&gt; m -&gt; ModGuts
</span><a href="GHC.html#coreModule"><span class="hs-identifier hs-var">coreModule</span></a></span><span> </span><span class="annot"><span class="annottext">(DesugaredModule -&gt; (TcGblEnv, ModGuts))
-&gt; m DesugaredModule -&gt; m (TcGblEnv, ModGuts)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule -&gt; m DesugaredModule
forall (m :: * -&gt; *).
GhcMonad m =&gt;
TypecheckedModule -&gt; m DesugaredModule
</span><a href="GHC.html#desugarModule"><span class="hs-identifier hs-var">desugarModule</span></a></span><span> </span><span class="annot"><span class="annottext">TypecheckedModule
</span><a href="#local-6989586621681208274"><span class="hs-identifier hs-var">tm</span></a></span><span>
</span><span id="line-1103"></span><span>       </span><span class="annot"><span class="annottext">(Either (CgGuts, ModDetails) ModGuts -&gt; CoreModule)
-&gt; m (Either (CgGuts, ModDetails) ModGuts) -&gt; m CoreModule
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SafeHaskellMode
-&gt; Either (CgGuts, ModDetails) ModGuts -&gt; CoreModule
</span><a href="#local-6989586621681208270"><span class="hs-identifier hs-var">gutsToCoreModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; SafeHaskellMode
</span><a href="GHC.Driver.Types.html#mg_safe_haskell"><span class="hs-identifier hs-var hs-var">mg_safe_haskell</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208275"><span class="hs-identifier hs-var">mod_guts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m (Either (CgGuts, ModDetails) ModGuts) -&gt; m CoreModule)
-&gt; m (Either (CgGuts, ModDetails) ModGuts) -&gt; m CoreModule
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1104"></span><span>         </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681208284"><span class="hs-identifier hs-var">simplify</span></a></span><span>
</span><span id="line-1105"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1106"></span><span>             </span><span class="hs-comment">-- If simplify is true: simplify (hscSimplify), then tidy</span><span>
</span><span id="line-1107"></span><span>             </span><span class="hs-comment">-- (tidyProgram).</span><span>
</span><span id="line-1108"></span><span>             </span><span id="local-6989586621681208268"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208268"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1109"></span><span>             </span><span id="local-6989586621681208267"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208267"><span class="hs-identifier hs-var">simpl_guts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModGuts -&gt; m ModGuts
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModGuts -&gt; m ModGuts) -&gt; IO ModGuts -&gt; m ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1110"></span><span>               </span><span id="local-6989586621681208266"><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681208266"><span class="hs-identifier hs-var">plugins</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef [FilePath] -&gt; IO [FilePath]
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; IORef [FilePath]
</span><a href="GHC.Tc.Types.html#tcg_th_coreplugins"><span class="hs-identifier hs-var hs-var">tcg_th_coreplugins</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681208276"><span class="hs-identifier hs-var">tcg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1111"></span><span>               </span><span class="annot"><span class="annottext">HscEnv -&gt; [FilePath] -&gt; ModGuts -&gt; IO ModGuts
</span><a href="GHC.Driver.Main.html#hscSimplify"><span class="hs-identifier hs-var">hscSimplify</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208268"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681208266"><span class="hs-identifier hs-var">plugins</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208275"><span class="hs-identifier hs-var">mod_guts</span></a></span><span>
</span><span id="line-1112"></span><span>             </span><span id="local-6989586621681208262"><span class="annot"><span class="annottext">(CgGuts, ModDetails)
</span><a href="#local-6989586621681208262"><span class="hs-identifier hs-var">tidy_guts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (CgGuts, ModDetails) -&gt; m (CgGuts, ModDetails)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (CgGuts, ModDetails) -&gt; m (CgGuts, ModDetails))
-&gt; IO (CgGuts, ModDetails) -&gt; m (CgGuts, ModDetails)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModGuts -&gt; IO (CgGuts, ModDetails)
</span><a href="GHC.Iface.Tidy.html#tidyProgram"><span class="hs-identifier hs-var">tidyProgram</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208268"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208267"><span class="hs-identifier hs-var">simpl_guts</span></a></span><span>
</span><span id="line-1113"></span><span>             </span><span class="annot"><span class="annottext">Either (CgGuts, ModDetails) ModGuts
-&gt; m (Either (CgGuts, ModDetails) ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either (CgGuts, ModDetails) ModGuts
 -&gt; m (Either (CgGuts, ModDetails) ModGuts))
-&gt; Either (CgGuts, ModDetails) ModGuts
-&gt; m (Either (CgGuts, ModDetails) ModGuts)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(CgGuts, ModDetails) -&gt; Either (CgGuts, ModDetails) ModGuts
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(CgGuts, ModDetails)
</span><a href="#local-6989586621681208262"><span class="hs-identifier hs-var">tidy_guts</span></a></span><span>
</span><span id="line-1114"></span><span>          </span><span class="hs-keyword">else</span><span>
</span><span id="line-1115"></span><span>             </span><span class="annot"><span class="annottext">Either (CgGuts, ModDetails) ModGuts
-&gt; m (Either (CgGuts, ModDetails) ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either (CgGuts, ModDetails) ModGuts
 -&gt; m (Either (CgGuts, ModDetails) ModGuts))
-&gt; Either (CgGuts, ModDetails) ModGuts
-&gt; m (Either (CgGuts, ModDetails) ModGuts)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; Either (CgGuts, ModDetails) ModGuts
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208275"><span class="hs-identifier hs-var">mod_guts</span></a></span><span>
</span><span id="line-1116"></span><span>
</span><span id="line-1117"></span><span>     </span><span class="annot"><span class="annottext">Maybe ModSummary
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; m CoreModule
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span class=""> &quot;compileToCoreModule: target FilePath not found in\
</span><span>                           </span><span class="hs-keyword">module</span><span> </span><span class="hs-keyword">dependency</span><span> </span><span class="hs-identifier">graph</span><span class="">&quot;
</span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-comment">-- two versions, based on whether we simplify (thus run tidyProgram,</span><span>
</span><span id="line-1120"></span><span>        </span><span class="hs-comment">-- which returns a (CgGuts, ModDetails) pair, or not (in which case</span><span>
</span><span id="line-1121"></span><span>        </span><span class="hs-comment">-- we just have a ModGuts.</span><span>
</span><span id="line-1122"></span><span>        </span><span class="annot"><a href="#local-6989586621681208270"><span class="hs-identifier hs-type">gutsToCoreModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#SafeHaskellMode"><span class="hs-identifier hs-type">SafeHaskellMode</span></a></span><span>
</span><span id="line-1123"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#CgGuts"><span class="hs-identifier hs-type">CgGuts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModDetails"><span class="hs-identifier hs-type">ModDetails</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-1124"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span><span>
</span><span id="line-1125"></span><span>        </span><span id="local-6989586621681208270"><span class="annot"><span class="annottext">gutsToCoreModule :: SafeHaskellMode
-&gt; Either (CgGuts, ModDetails) ModGuts -&gt; CoreModule
</span><a href="#local-6989586621681208270"><span class="hs-identifier hs-var hs-var">gutsToCoreModule</span></a></span></span><span> </span><span id="local-6989586621681208260"><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208260"><span class="hs-identifier hs-var">safe_mode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208259"><span class="annot"><span class="annottext">CgGuts
</span><a href="#local-6989586621681208259"><span class="hs-identifier hs-var">cg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208258"><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208258"><span class="hs-identifier hs-var">md</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreModule :: Module -&gt; TypeEnv -&gt; CoreProgram -&gt; SafeHaskellMode -&gt; CoreModule
</span><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1126"></span><span>          </span><span class="annot"><span class="annottext">cm_module :: Module
</span><a href="GHC.html#cm_module"><span class="hs-identifier hs-var">cm_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#cg_module"><span class="hs-identifier hs-var hs-var">cg_module</span></a></span><span> </span><span class="annot"><span class="annottext">CgGuts
</span><a href="#local-6989586621681208259"><span class="hs-identifier hs-var">cg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1127"></span><span>          </span><span class="annot"><span class="annottext">cm_types :: TypeEnv
</span><a href="GHC.html#cm_types"><span class="hs-identifier hs-var">cm_types</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#md_types"><span class="hs-identifier hs-var hs-var">md_types</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208258"><span class="hs-identifier hs-var">md</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1128"></span><span>          </span><span class="annot"><span class="annottext">cm_binds :: CoreProgram
</span><a href="GHC.html#cm_binds"><span class="hs-identifier hs-var">cm_binds</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#cg_binds"><span class="hs-identifier hs-var hs-var">cg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgGuts
</span><a href="#local-6989586621681208259"><span class="hs-identifier hs-var">cg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1129"></span><span>          </span><span class="annot"><span class="annottext">cm_safe :: SafeHaskellMode
</span><a href="GHC.html#cm_safe"><span class="hs-identifier hs-var">cm_safe</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208260"><span class="hs-identifier hs-var">safe_mode</span></a></span><span>
</span><span id="line-1130"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-1131"></span><span>        </span><span class="annot"><a href="#local-6989586621681208270"><span class="hs-identifier hs-var">gutsToCoreModule</span></a></span><span> </span><span id="local-6989586621681208255"><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208255"><span class="hs-identifier hs-var">safe_mode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681208254"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreModule :: Module -&gt; TypeEnv -&gt; CoreProgram -&gt; SafeHaskellMode -&gt; CoreModule
</span><a href="GHC.html#CoreModule"><span class="hs-identifier hs-type">CoreModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1132"></span><span>          </span><span class="annot"><span class="annottext">cm_module :: Module
</span><a href="GHC.html#cm_module"><span class="hs-identifier hs-var">cm_module</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#mg_module"><span class="hs-identifier hs-var hs-var">mg_module</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1133"></span><span>          </span><span class="annot"><span class="annottext">cm_types :: TypeEnv
</span><a href="GHC.html#cm_types"><span class="hs-identifier hs-var">cm_types</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Var] -&gt; [TyCon] -&gt; [FamInst] -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#typeEnvFromEntities"><span class="hs-identifier hs-var">typeEnvFromEntities</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreProgram -&gt; [Var]
forall b. [Bind b] -&gt; [b]
</span><a href="GHC.Core.html#bindersOfBinds"><span class="hs-identifier hs-var">bindersOfBinds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1134"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; [TyCon]
</span><a href="GHC.Driver.Types.html#mg_tcs"><span class="hs-identifier hs-var hs-var">mg_tcs</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1135"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; [FamInst]
</span><a href="GHC.Driver.Types.html#mg_fam_insts"><span class="hs-identifier hs-var hs-var">mg_fam_insts</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-1136"></span><span>          </span><span class="annot"><span class="annottext">cm_binds :: CoreProgram
</span><a href="GHC.html#cm_binds"><span class="hs-identifier hs-var">cm_binds</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681208254"><span class="hs-identifier hs-var">mg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1137"></span><span>          </span><span class="annot"><span class="annottext">cm_safe :: SafeHaskellMode
</span><a href="GHC.html#cm_safe"><span class="hs-identifier hs-var">cm_safe</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681208255"><span class="hs-identifier hs-var">safe_mode</span></a></span><span>
</span><span id="line-1138"></span><span>         </span><span class="hs-special">}</span><span>
</span><span id="line-1139"></span><span>
</span><span id="line-1140"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-1141"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-1142"></span><span class="hs-comment">--             Inspecting the session</span><span>
</span><span id="line-1143"></span><span class="hs-comment">-- %*                                                                      *</span><span>
</span><span id="line-1144"></span><span class="hs-comment">-- %************************************************************************</span><span>
</span><span id="line-1145"></span><span>
</span><span id="line-1146"></span><span class="hs-comment">-- | Get the module dependency graph.</span><span>
</span><span id="line-1147"></span><span id="local-6989586621681209678"><span class="annot"><a href="GHC.html#getModuleGraph"><span class="hs-identifier hs-type">getModuleGraph</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209678"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209678"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModuleGraph"><span class="hs-identifier hs-type">ModuleGraph</span></a></span></span><span> </span><span class="hs-comment">-- ToDo: DiGraph ModSummary</span><span>
</span><span id="line-1148"></span><span id="getModuleGraph"><span class="annot"><span class="annottext">getModuleGraph :: forall (m :: * -&gt; *). GhcMonad m =&gt; m ModuleGraph
</span><a href="GHC.html#getModuleGraph"><span class="hs-identifier hs-var hs-var">getModuleGraph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; ModuleGraph) -&gt; m HscEnv -&gt; m ModuleGraph
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#hsc_mod_graph"><span class="hs-identifier hs-var hs-var">hsc_mod_graph</span></a></span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1149"></span><span>
</span><span id="line-1150"></span><span class="hs-comment">-- | Return @True@ \&lt;==&gt; module is loaded.</span><span>
</span><span id="line-1151"></span><span id="local-6989586621681209676"><span class="annot"><a href="GHC.html#isLoaded"><span class="hs-identifier hs-type">isLoaded</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209676"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209676"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-1152"></span><span id="isLoaded"><span class="annot"><span class="annottext">isLoaded :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m Bool
</span><a href="GHC.html#isLoaded"><span class="hs-identifier hs-var hs-var">isLoaded</span></a></span></span><span> </span><span id="local-6989586621681208233"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681208233"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Bool) -&gt; m Bool
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Bool) -&gt; m Bool) -&gt; (HscEnv -&gt; m Bool) -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208232"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208232"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1153"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; m Bool) -&gt; Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe HomeModInfo -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208232"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681208233"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1154"></span><span>
</span><span id="line-1155"></span><span class="hs-comment">-- | Return the bindings for the current interactive session.</span><span>
</span><span id="line-1156"></span><span id="local-6989586621681209674"><span class="annot"><a href="GHC.html#getBindings"><span class="hs-identifier hs-type">getBindings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209674"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209674"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1157"></span><span id="getBindings"><span class="annot"><span class="annottext">getBindings :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [TyThing]
</span><a href="GHC.html#getBindings"><span class="hs-identifier hs-var hs-var">getBindings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [TyThing]) -&gt; m [TyThing]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [TyThing]) -&gt; m [TyThing])
-&gt; (HscEnv -&gt; m [TyThing]) -&gt; m [TyThing]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208221"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208221"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1158"></span><span>    </span><span class="annot"><span class="annottext">[TyThing] -&gt; m [TyThing]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([TyThing] -&gt; m [TyThing]) -&gt; [TyThing] -&gt; m [TyThing]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#icInScopeTTs"><span class="hs-identifier hs-var">icInScopeTTs</span></a></span><span> </span><span class="annot"><span class="annottext">(InteractiveContext -&gt; [TyThing])
-&gt; InteractiveContext -&gt; [TyThing]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208221"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1159"></span><span>
</span><span id="line-1160"></span><span class="hs-comment">-- | Return the instances for the current interactive session.</span><span>
</span><span id="line-1161"></span><span id="local-6989586621681209672"><span class="annot"><a href="GHC.html#getInsts"><span class="hs-identifier hs-type">getInsts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209672"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209672"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier hs-type">FamInst</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-1162"></span><span id="getInsts"><span class="annot"><span class="annottext">getInsts :: forall (m :: * -&gt; *). GhcMonad m =&gt; m ([ClsInst], [FamInst])
</span><a href="GHC.html#getInsts"><span class="hs-identifier hs-var hs-var">getInsts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ([ClsInst], [FamInst])) -&gt; m ([ClsInst], [FamInst])
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m ([ClsInst], [FamInst])) -&gt; m ([ClsInst], [FamInst]))
-&gt; (HscEnv -&gt; m ([ClsInst], [FamInst])) -&gt; m ([ClsInst], [FamInst])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208212"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208212"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1163"></span><span>    </span><span class="annot"><span class="annottext">([ClsInst], [FamInst]) -&gt; m ([ClsInst], [FamInst])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(([ClsInst], [FamInst]) -&gt; m ([ClsInst], [FamInst]))
-&gt; ([ClsInst], [FamInst]) -&gt; m ([ClsInst], [FamInst])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; ([ClsInst], [FamInst])
</span><a href="GHC.Driver.Types.html#ic_instances"><span class="hs-identifier hs-var hs-var">ic_instances</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208212"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1164"></span><span>
</span><span id="line-1165"></span><span id="local-6989586621681209670"><span class="annot"><a href="GHC.html#getPrintUnqual"><span class="hs-identifier hs-type">getPrintUnqual</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209670"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209670"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span></span><span>
</span><span id="line-1166"></span><span id="getPrintUnqual"><span class="annot"><span class="annottext">getPrintUnqual :: forall (m :: * -&gt; *). GhcMonad m =&gt; m PrintUnqualified
</span><a href="GHC.html#getPrintUnqual"><span class="hs-identifier hs-var hs-var">getPrintUnqual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m PrintUnqualified) -&gt; m PrintUnqualified
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m PrintUnqualified) -&gt; m PrintUnqualified)
-&gt; (HscEnv -&gt; m PrintUnqualified) -&gt; m PrintUnqualified
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208203"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208203"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1167"></span><span>  </span><span class="annot"><span class="annottext">PrintUnqualified -&gt; m PrintUnqualified
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; InteractiveContext -&gt; PrintUnqualified
</span><a href="GHC.Driver.Types.html#icPrintUnqual"><span class="hs-identifier hs-var">icPrintUnqual</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208203"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208203"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1168"></span><span>
</span><span id="line-1169"></span><span class="hs-comment">-- | Container for information about a 'Module'.</span><span>
</span><span id="line-1170"></span><span class="hs-keyword">data</span><span> </span><span id="ModuleInfo"><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-var">ModuleInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ModuleInfo"><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-var">ModuleInfo</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1171"></span><span>        </span><span id="minf_type_env"><span class="annot"><span class="annottext">ModuleInfo -&gt; TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var hs-var">minf_type_env</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#TypeEnv"><span class="hs-identifier hs-type">TypeEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1172"></span><span>        </span><span id="minf_exports"><span class="annot"><span class="annottext">ModuleInfo -&gt; [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var hs-var">minf_exports</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Avail.html#AvailInfo"><span class="hs-identifier hs-type">AvailInfo</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-1173"></span><span>        </span><span id="minf_rdr_env"><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var hs-var">minf_rdr_env</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- Nothing for a compiled/package mod</span><span>
</span><span id="line-1174"></span><span>        </span><span id="minf_instances"><span class="annot"><span class="annottext">ModuleInfo -&gt; [ClsInst]
</span><a href="GHC.html#minf_instances"><span class="hs-identifier hs-var hs-var">minf_instances</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-1175"></span><span>        </span><span id="minf_iface"><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe ModIface
</span><a href="GHC.html#minf_iface"><span class="hs-identifier hs-var hs-var">minf_iface</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModIface"><span class="hs-identifier hs-type">ModIface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1176"></span><span>        </span><span id="minf_safe"><span class="annot"><span class="annottext">ModuleInfo -&gt; SafeHaskellMode
</span><a href="GHC.html#minf_safe"><span class="hs-identifier hs-var hs-var">minf_safe</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#SafeHaskellMode"><span class="hs-identifier hs-type">SafeHaskellMode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1177"></span><span>        </span><span id="minf_modBreaks"><span class="annot"><span class="annottext">ModuleInfo -&gt; ModBreaks
</span><a href="GHC.html#minf_modBreaks"><span class="hs-identifier hs-var hs-var">minf_modBreaks</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ModBreaks"><span class="hs-identifier hs-type">ModBreaks</span></a></span><span>
</span><span id="line-1178"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-1179"></span><span>        </span><span class="hs-comment">-- We don't want HomeModInfo here, because a ModuleInfo applies</span><span>
</span><span id="line-1180"></span><span>        </span><span class="hs-comment">-- to package modules too.</span><span>
</span><span id="line-1181"></span><span>
</span><span id="line-1182"></span><span class="hs-comment">-- | Request information about a loaded 'Module'</span><span>
</span><span id="line-1183"></span><span id="local-6989586621681209667"><span class="annot"><a href="GHC.html#getModuleInfo"><span class="hs-identifier hs-type">getModuleInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209667"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209667"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span class="hs-special">)</span></span><span>  </span><span class="hs-comment">-- XXX: Maybe X</span><span>
</span><span id="line-1184"></span><span id="getModuleInfo"><span class="annot"><span class="annottext">getModuleInfo :: forall (m :: * -&gt; *). GhcMonad m =&gt; Module -&gt; m (Maybe ModuleInfo)
</span><a href="GHC.html#getModuleInfo"><span class="hs-identifier hs-var hs-var">getModuleInfo</span></a></span></span><span> </span><span id="local-6989586621681208195"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208195"><span class="hs-identifier hs-var">mdl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe ModuleInfo)) -&gt; m (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe ModuleInfo)) -&gt; m (Maybe ModuleInfo))
-&gt; (HscEnv -&gt; m (Maybe ModuleInfo)) -&gt; m (Maybe ModuleInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208194"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208194"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1185"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208193"><span class="annot"><span class="annottext">mg :: ModuleGraph
</span><a href="#local-6989586621681208193"><span class="hs-identifier hs-var hs-var">mg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#hsc_mod_graph"><span class="hs-identifier hs-var hs-var">hsc_mod_graph</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208194"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1186"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ModuleGraph -&gt; Module -&gt; Bool
</span><a href="GHC.Driver.Types.html#mgElemModule"><span class="hs-identifier hs-var">mgElemModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681208193"><span class="hs-identifier hs-var">mg</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208195"><span class="hs-identifier hs-var">mdl</span></a></span><span>
</span><span id="line-1187"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo))
-&gt; IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; IO (Maybe ModuleInfo)
</span><a href="GHC.html#getHomeModuleInfo"><span class="hs-identifier hs-var">getHomeModuleInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208194"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208195"><span class="hs-identifier hs-var">mdl</span></a></span><span>
</span><span id="line-1188"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1189"></span><span>  </span><span class="hs-comment">{- if isHomeModule (hsc_dflags hsc_env) mdl
        then return Nothing
        else -}</span><span> </span><span class="annot"><span class="annottext">IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo))
-&gt; IO (Maybe ModuleInfo) -&gt; m (Maybe ModuleInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; IO (Maybe ModuleInfo)
</span><a href="GHC.html#getPackageModuleInfo"><span class="hs-identifier hs-var">getPackageModuleInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208194"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208195"><span class="hs-identifier hs-var">mdl</span></a></span><span>
</span><span id="line-1192"></span><span>   </span><span class="hs-comment">-- ToDo: we don't understand what the following comment means.</span><span>
</span><span id="line-1193"></span><span>   </span><span class="hs-comment">--    (SDM, 19/7/2011)</span><span>
</span><span id="line-1194"></span><span>   </span><span class="hs-comment">-- getPackageModuleInfo will attempt to find the interface, so</span><span>
</span><span id="line-1195"></span><span>   </span><span class="hs-comment">-- we don't want to call it for a home module, just in case there</span><span>
</span><span id="line-1196"></span><span>   </span><span class="hs-comment">-- was a problem loading the module and the interface doesn't</span><span>
</span><span id="line-1197"></span><span>   </span><span class="hs-comment">-- exist... hence the isHomeModule test here.  (ToDo: reinstate)</span><span>
</span><span id="line-1198"></span><span>
</span><span id="line-1199"></span><span class="annot"><a href="GHC.html#getPackageModuleInfo"><span class="hs-identifier hs-type">getPackageModuleInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1200"></span><span id="getPackageModuleInfo"><span class="annot"><span class="annottext">getPackageModuleInfo :: HscEnv -&gt; Module -&gt; IO (Maybe ModuleInfo)
</span><a href="GHC.html#getPackageModuleInfo"><span class="hs-identifier hs-var hs-var">getPackageModuleInfo</span></a></span></span><span> </span><span id="local-6989586621681208189"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208189"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681208188"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208188"><span class="hs-identifier hs-var">mdl</span></a></span></span><span>
</span><span id="line-1201"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span id="local-6989586621681208187"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681208187"><span class="hs-identifier hs-var">eps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO ExternalPackageState
</span><a href="GHC.Driver.Types.html#hscEPS"><span class="hs-identifier hs-var">hscEPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208189"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1202"></span><span>        </span><span id="local-6989586621681208185"><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208185"><span class="hs-identifier hs-var">iface</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; IO ModIface
</span><a href="GHC.Driver.Main.html#hscGetModuleInterface"><span class="hs-identifier hs-var">hscGetModuleInterface</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208189"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208188"><span class="hs-identifier hs-var">mdl</span></a></span><span>
</span><span id="line-1203"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-1204"></span><span>            </span><span id="local-6989586621681208183"><span class="annot"><span class="annottext">avails :: [AvailInfo]
</span><a href="#local-6989586621681208183"><span class="hs-identifier hs-var hs-var">avails</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; [AvailInfo]
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; [AvailInfo]
</span><a href="GHC.Driver.Types.html#mi_exports"><span class="hs-identifier hs-var hs-var">mi_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208185"><span class="hs-identifier hs-var">iface</span></a></span><span>
</span><span id="line-1205"></span><span>            </span><span id="local-6989586621681208181"><span class="annot"><span class="annottext">pte :: TypeEnv
</span><a href="#local-6989586621681208181"><span class="hs-identifier hs-var hs-var">pte</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExternalPackageState -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#eps_PTE"><span class="hs-identifier hs-var hs-var">eps_PTE</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681208187"><span class="hs-identifier hs-var">eps</span></a></span><span>
</span><span id="line-1206"></span><span>            </span><span id="local-6989586621681208179"><span class="annot"><span class="annottext">tys :: [TyThing]
</span><a href="#local-6989586621681208179"><span class="hs-identifier hs-var hs-var">tys</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681208178"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681208177"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208177"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(AvailInfo -&gt; [Name]) -&gt; [AvailInfo] -&gt; [Name]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">AvailInfo -&gt; [Name]
</span><a href="GHC.Types.Avail.html#availNames"><span class="hs-identifier hs-var">availNames</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681208183"><span class="hs-identifier hs-var">avails</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1207"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208178"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681208178"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TypeEnv -&gt; Name -&gt; Maybe TyThing
</span><a href="GHC.Driver.Types.html#lookupTypeEnv"><span class="hs-identifier hs-var">lookupTypeEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TypeEnv
</span><a href="#local-6989586621681208181"><span class="hs-identifier hs-var">pte</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208177"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1208"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-1209"></span><span>        </span><span class="annot"><span class="annottext">Maybe ModuleInfo -&gt; IO (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe ModuleInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo :: TypeEnv
-&gt; [AvailInfo]
-&gt; Maybe GlobalRdrEnv
-&gt; [ClsInst]
-&gt; Maybe ModIface
-&gt; SafeHaskellMode
-&gt; ModBreaks
-&gt; ModuleInfo
</span><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1210"></span><span>                        </span><span class="annot"><span class="annottext">minf_type_env :: TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var">minf_type_env</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyThing] -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#mkTypeEnv"><span class="hs-identifier hs-var">mkTypeEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681208179"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1211"></span><span>                        </span><span class="annot"><span class="annottext">minf_exports :: [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var">minf_exports</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681208183"><span class="hs-identifier hs-var">avails</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1212"></span><span>                        </span><span class="annot"><span class="annottext">minf_rdr_env :: Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var">minf_rdr_env</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Maybe GlobalRdrEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; Maybe GlobalRdrEnv)
-&gt; GlobalRdrEnv -&gt; Maybe GlobalRdrEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [AvailInfo] -&gt; GlobalRdrEnv
</span><a href="GHC.Runtime.Eval.html#availsToGlobalRdrEnv"><span class="hs-identifier hs-var">availsToGlobalRdrEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208188"><span class="hs-identifier hs-var">mdl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681208183"><span class="hs-identifier hs-var">avails</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1213"></span><span>                        </span><span class="annot"><span class="annottext">minf_instances :: [ClsInst]
</span><a href="GHC.html#minf_instances"><span class="hs-identifier hs-var">minf_instances</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [ClsInst]
forall a. HasCallStack =&gt; FilePath -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;getModuleInfo: instances for package module unimplemented&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-1214"></span><span>                        </span><span class="annot"><span class="annottext">minf_iface :: Maybe ModIface
</span><a href="GHC.html#minf_iface"><span class="hs-identifier hs-var">minf_iface</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; Maybe ModIface
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208185"><span class="hs-identifier hs-var">iface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1215"></span><span>                        </span><span class="annot"><span class="annottext">minf_safe :: SafeHaskellMode
</span><a href="GHC.html#minf_safe"><span class="hs-identifier hs-var">minf_safe</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IfaceTrustInfo -&gt; SafeHaskellMode
</span><a href="GHC.Driver.Types.html#getSafeMode"><span class="hs-identifier hs-var">getSafeMode</span></a></span><span> </span><span class="annot"><span class="annottext">(IfaceTrustInfo -&gt; SafeHaskellMode)
-&gt; IfaceTrustInfo -&gt; SafeHaskellMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; IfaceTrustInfo
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; IfaceTrustInfo
</span><a href="GHC.Driver.Types.html#mi_trust"><span class="hs-identifier hs-var hs-var">mi_trust</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208185"><span class="hs-identifier hs-var">iface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1216"></span><span>                        </span><span class="annot"><span class="annottext">minf_modBreaks :: ModBreaks
</span><a href="GHC.html#minf_modBreaks"><span class="hs-identifier hs-var">minf_modBreaks</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="GHC.ByteCode.Types.html#emptyModBreaks"><span class="hs-identifier hs-var">emptyModBreaks</span></a></span><span>
</span><span id="line-1217"></span><span>                </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1218"></span><span>
</span><span id="line-1219"></span><span class="annot"><a href="GHC.html#getHomeModuleInfo"><span class="hs-identifier hs-type">getHomeModuleInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1220"></span><span id="getHomeModuleInfo"><span class="annot"><span class="annottext">getHomeModuleInfo :: HscEnv -&gt; Module -&gt; IO (Maybe ModuleInfo)
</span><a href="GHC.html#getHomeModuleInfo"><span class="hs-identifier hs-var hs-var">getHomeModuleInfo</span></a></span></span><span> </span><span id="local-6989586621681208168"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208168"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681208167"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208167"><span class="hs-identifier hs-var">mdl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1221"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208168"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681208167"><span class="hs-identifier hs-var">mdl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1222"></span><span>    </span><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ModuleInfo -&gt; IO (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1223"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208166"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208166"><span class="hs-identifier hs-var">hmi</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1224"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208165"><span class="annot"><span class="annottext">details :: ModDetails
</span><a href="#local-6989586621681208165"><span class="hs-identifier hs-var hs-var">details</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModDetails
</span><a href="GHC.Driver.Types.html#hm_details"><span class="hs-identifier hs-var hs-var">hm_details</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208166"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-1225"></span><span>          </span><span id="local-6989586621681208163"><span class="annot"><span class="annottext">iface :: ModIface
</span><a href="#local-6989586621681208163"><span class="hs-identifier hs-var hs-var">iface</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208166"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-1226"></span><span>      </span><span class="annot"><span class="annottext">Maybe ModuleInfo -&gt; IO (Maybe ModuleInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe ModuleInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo :: TypeEnv
-&gt; [AvailInfo]
-&gt; Maybe GlobalRdrEnv
-&gt; [ClsInst]
-&gt; Maybe ModIface
-&gt; SafeHaskellMode
-&gt; ModBreaks
-&gt; ModuleInfo
</span><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1227"></span><span>                        </span><span class="annot"><span class="annottext">minf_type_env :: TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var">minf_type_env</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#md_types"><span class="hs-identifier hs-var hs-var">md_types</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208165"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1228"></span><span>                        </span><span class="annot"><span class="annottext">minf_exports :: [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var">minf_exports</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; [AvailInfo]
</span><a href="GHC.Driver.Types.html#md_exports"><span class="hs-identifier hs-var hs-var">md_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208165"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1229"></span><span>                        </span><span class="annot"><span class="annottext">minf_rdr_env :: Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var">minf_rdr_env</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; Maybe GlobalRdrEnv
forall (phase :: ModIfacePhase).
ModIface_ phase -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#mi_globals"><span class="hs-identifier hs-var hs-var">mi_globals</span></a></span><span> </span><span class="annot"><span class="annottext">(ModIface -&gt; Maybe GlobalRdrEnv) -&gt; ModIface -&gt; Maybe GlobalRdrEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208166"><span class="hs-identifier hs-var">hmi</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1230"></span><span>                        </span><span class="annot"><span class="annottext">minf_instances :: [ClsInst]
</span><a href="GHC.html#minf_instances"><span class="hs-identifier hs-var">minf_instances</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModDetails -&gt; [ClsInst]
</span><a href="GHC.Driver.Types.html#md_insts"><span class="hs-identifier hs-var hs-var">md_insts</span></a></span><span> </span><span class="annot"><span class="annottext">ModDetails
</span><a href="#local-6989586621681208165"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1231"></span><span>                        </span><span class="annot"><span class="annottext">minf_iface :: Maybe ModIface
</span><a href="GHC.html#minf_iface"><span class="hs-identifier hs-var">minf_iface</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; Maybe ModIface
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208163"><span class="hs-identifier hs-var">iface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1232"></span><span>                        </span><span class="annot"><span class="annottext">minf_safe :: SafeHaskellMode
</span><a href="GHC.html#minf_safe"><span class="hs-identifier hs-var">minf_safe</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IfaceTrustInfo -&gt; SafeHaskellMode
</span><a href="GHC.Driver.Types.html#getSafeMode"><span class="hs-identifier hs-var">getSafeMode</span></a></span><span> </span><span class="annot"><span class="annottext">(IfaceTrustInfo -&gt; SafeHaskellMode)
-&gt; IfaceTrustInfo -&gt; SafeHaskellMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; IfaceTrustInfo
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; IfaceTrustInfo
</span><a href="GHC.Driver.Types.html#mi_trust"><span class="hs-identifier hs-var hs-var">mi_trust</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681208163"><span class="hs-identifier hs-var">iface</span></a></span><span>
</span><span id="line-1233"></span><span>                       </span><span class="hs-special">,</span><span class="annot"><span class="annottext">minf_modBreaks :: ModBreaks
</span><a href="GHC.html#minf_modBreaks"><span class="hs-identifier hs-var">minf_modBreaks</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModBreaks
</span><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier hs-var">getModBreaks</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681208166"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-1234"></span><span>                        </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1235"></span><span>
</span><span id="line-1236"></span><span class="hs-comment">-- | The list of top-level entities defined in a module</span><span>
</span><span id="line-1237"></span><span class="annot"><a href="GHC.html#modInfoTyThings"><span class="hs-identifier hs-type">modInfoTyThings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1238"></span><span id="modInfoTyThings"><span class="annot"><span class="annottext">modInfoTyThings :: ModuleInfo -&gt; [TyThing]
</span><a href="GHC.html#modInfoTyThings"><span class="hs-identifier hs-var hs-var">modInfoTyThings</span></a></span></span><span> </span><span id="local-6989586621681208159"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208159"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypeEnv -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#typeEnvElts"><span class="hs-identifier hs-var">typeEnvElts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var hs-var">minf_type_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208159"><span class="hs-identifier hs-var">minf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1239"></span><span>
</span><span id="line-1240"></span><span class="annot"><a href="GHC.html#modInfoTopLevelScope"><span class="hs-identifier hs-type">modInfoTopLevelScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1241"></span><span id="modInfoTopLevelScope"><span class="annot"><span class="annottext">modInfoTopLevelScope :: ModuleInfo -&gt; Maybe [Name]
</span><a href="GHC.html#modInfoTopLevelScope"><span class="hs-identifier hs-var hs-var">modInfoTopLevelScope</span></a></span></span><span> </span><span id="local-6989586621681208157"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208157"><span class="hs-identifier hs-var">minf</span></a></span></span><span>
</span><span id="line-1242"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; [Name]) -&gt; Maybe GlobalRdrEnv -&gt; Maybe [Name]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Name) -&gt; [GlobalRdrElt] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobalRdrElt] -&gt; [Name])
-&gt; (GlobalRdrEnv -&gt; [GlobalRdrElt]) -&gt; GlobalRdrEnv -&gt; [Name]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var hs-var">minf_rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208157"><span class="hs-identifier hs-var">minf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1243"></span><span>
</span><span id="line-1244"></span><span class="annot"><a href="GHC.html#modInfoExports"><span class="hs-identifier hs-type">modInfoExports</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1245"></span><span id="modInfoExports"><span class="annot"><span class="annottext">modInfoExports :: ModuleInfo -&gt; [Name]
</span><a href="GHC.html#modInfoExports"><span class="hs-identifier hs-var hs-var">modInfoExports</span></a></span></span><span> </span><span id="local-6989586621681208154"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208154"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(AvailInfo -&gt; [Name]) -&gt; [AvailInfo] -&gt; [Name]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">AvailInfo -&gt; [Name]
</span><a href="GHC.Types.Avail.html#availNames"><span class="hs-identifier hs-var">availNames</span></a></span><span> </span><span class="annot"><span class="annottext">([AvailInfo] -&gt; [Name]) -&gt; [AvailInfo] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var hs-var">minf_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208154"><span class="hs-identifier hs-var">minf</span></a></span><span>
</span><span id="line-1246"></span><span>
</span><span id="line-1247"></span><span class="annot"><a href="GHC.html#modInfoExportsWithSelectors"><span class="hs-identifier hs-type">modInfoExportsWithSelectors</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1248"></span><span id="modInfoExportsWithSelectors"><span class="annot"><span class="annottext">modInfoExportsWithSelectors :: ModuleInfo -&gt; [Name]
</span><a href="GHC.html#modInfoExportsWithSelectors"><span class="hs-identifier hs-var hs-var">modInfoExportsWithSelectors</span></a></span></span><span> </span><span id="local-6989586621681208153"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208153"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(AvailInfo -&gt; [Name]) -&gt; [AvailInfo] -&gt; [Name]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">AvailInfo -&gt; [Name]
</span><a href="GHC.Types.Avail.html#availNamesWithSelectors"><span class="hs-identifier hs-var">availNamesWithSelectors</span></a></span><span> </span><span class="annot"><span class="annottext">([AvailInfo] -&gt; [Name]) -&gt; [AvailInfo] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var hs-var">minf_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208153"><span class="hs-identifier hs-var">minf</span></a></span><span>
</span><span id="line-1249"></span><span>
</span><span id="line-1250"></span><span class="hs-comment">-- | Returns the instances defined by the specified module.</span><span>
</span><span id="line-1251"></span><span class="hs-comment">-- Warning: currently unimplemented for package modules.</span><span>
</span><span id="line-1252"></span><span class="annot"><a href="GHC.html#modInfoInstances"><span class="hs-identifier hs-type">modInfoInstances</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1253"></span><span id="modInfoInstances"><span class="annot"><span class="annottext">modInfoInstances :: ModuleInfo -&gt; [ClsInst]
</span><a href="GHC.html#modInfoInstances"><span class="hs-identifier hs-var hs-var">modInfoInstances</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; [ClsInst]
</span><a href="GHC.html#minf_instances"><span class="hs-identifier hs-var hs-var">minf_instances</span></a></span><span>
</span><span id="line-1254"></span><span>
</span><span id="line-1255"></span><span class="annot"><a href="GHC.html#modInfoIsExportedName"><span class="hs-identifier hs-type">modInfoIsExportedName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1256"></span><span id="modInfoIsExportedName"><span class="annot"><span class="annottext">modInfoIsExportedName :: ModuleInfo -&gt; Name -&gt; Bool
</span><a href="GHC.html#modInfoIsExportedName"><span class="hs-identifier hs-var hs-var">modInfoIsExportedName</span></a></span></span><span> </span><span id="local-6989586621681208151"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208151"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span id="local-6989586621681208150"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208150"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-identifier hs-var">elemNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208150"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[AvailInfo] -&gt; NameSet
</span><a href="GHC.Types.Avail.html#availsToNameSet"><span class="hs-identifier hs-var">availsToNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; [AvailInfo]
</span><a href="GHC.html#minf_exports"><span class="hs-identifier hs-var hs-var">minf_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208151"><span class="hs-identifier hs-var">minf</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1257"></span><span>
</span><span id="line-1258"></span><span id="local-6989586621681209645"><span class="annot"><a href="GHC.html#mkPrintUnqualifiedForModule"><span class="hs-identifier hs-type">mkPrintUnqualifiedForModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209645"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-1259"></span><span>                               </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span>
</span><span id="line-1260"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209645"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-comment">-- XXX: returns a Maybe X</span><span>
</span><span id="line-1261"></span><span id="mkPrintUnqualifiedForModule"><span class="annot"><span class="annottext">mkPrintUnqualifiedForModule :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
ModuleInfo -&gt; m (Maybe PrintUnqualified)
</span><a href="GHC.html#mkPrintUnqualifiedForModule"><span class="hs-identifier hs-var hs-var">mkPrintUnqualifiedForModule</span></a></span></span><span> </span><span id="local-6989586621681208139"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208139"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe PrintUnqualified))
-&gt; m (Maybe PrintUnqualified)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe PrintUnqualified))
 -&gt; m (Maybe PrintUnqualified))
-&gt; (HscEnv -&gt; m (Maybe PrintUnqualified))
-&gt; m (Maybe PrintUnqualified)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208138"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208138"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1262"></span><span>  </span><span class="annot"><span class="annottext">Maybe PrintUnqualified -&gt; m (Maybe PrintUnqualified)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; PrintUnqualified)
-&gt; Maybe GlobalRdrEnv -&gt; Maybe PrintUnqualified
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalRdrEnv -&gt; PrintUnqualified
</span><a href="GHC.Driver.Types.html#mkPrintUnqualified"><span class="hs-identifier hs-var">mkPrintUnqualified</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208138"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var hs-var">minf_rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208139"><span class="hs-identifier hs-var">minf</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1263"></span><span>
</span><span id="line-1264"></span><span id="local-6989586621681209643"><span class="annot"><a href="GHC.html#modInfoLookupName"><span class="hs-identifier hs-type">modInfoLookupName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209643"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-1265"></span><span>                     </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1266"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209643"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-comment">-- XXX: returns a Maybe X</span><span>
</span><span id="line-1267"></span><span id="modInfoLookupName"><span class="annot"><span class="annottext">modInfoLookupName :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
ModuleInfo -&gt; Name -&gt; m (Maybe TyThing)
</span><a href="GHC.html#modInfoLookupName"><span class="hs-identifier hs-var hs-var">modInfoLookupName</span></a></span></span><span> </span><span id="local-6989586621681208125"><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208125"><span class="hs-identifier hs-var">minf</span></a></span></span><span> </span><span id="local-6989586621681208124"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208124"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing))
-&gt; (HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208123"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208123"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1268"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TypeEnv -&gt; Name -&gt; Maybe TyThing
</span><a href="GHC.Driver.Types.html#lookupTypeEnv"><span class="hs-identifier hs-var">lookupTypeEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleInfo -&gt; TypeEnv
</span><a href="GHC.html#minf_type_env"><span class="hs-identifier hs-var hs-var">minf_type_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleInfo
</span><a href="#local-6989586621681208125"><span class="hs-identifier hs-var">minf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208124"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1269"></span><span>     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208122"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681208122"><span class="hs-identifier hs-var">tyThing</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe TyThing -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyThing -&gt; Maybe TyThing
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681208122"><span class="hs-identifier hs-var">tyThing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1270"></span><span>     </span><span class="annot"><span class="annottext">Maybe TyThing
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1271"></span><span>       </span><span id="local-6989586621681208121"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681208121"><span class="hs-identifier hs-var">eps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ExternalPackageState -&gt; m ExternalPackageState
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ExternalPackageState -&gt; m ExternalPackageState)
-&gt; IO ExternalPackageState -&gt; m ExternalPackageState
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IORef ExternalPackageState -&gt; IO ExternalPackageState
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef ExternalPackageState
</span><a href="GHC.Driver.Types.html#hsc_EPS"><span class="hs-identifier hs-var hs-var">hsc_EPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208123"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1272"></span><span>       </span><span class="annot"><span class="annottext">Maybe TyThing -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe TyThing -&gt; m (Maybe TyThing))
-&gt; Maybe TyThing -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HomePackageTable -&gt; TypeEnv -&gt; Name -&gt; Maybe TyThing
</span><a href="GHC.Driver.Types.html#lookupType"><span class="hs-identifier hs-var">lookupType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208123"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1273"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208123"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState -&gt; TypeEnv
</span><a href="GHC.Driver.Types.html#eps_PTE"><span class="hs-identifier hs-var hs-var">eps_PTE</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681208121"><span class="hs-identifier hs-var">eps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208124"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1274"></span><span>
</span><span id="line-1275"></span><span class="annot"><a href="GHC.html#modInfoIface"><span class="hs-identifier hs-type">modInfoIface</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModIface"><span class="hs-identifier hs-type">ModIface</span></a></span><span>
</span><span id="line-1276"></span><span id="modInfoIface"><span class="annot"><span class="annottext">modInfoIface :: ModuleInfo -&gt; Maybe ModIface
</span><a href="GHC.html#modInfoIface"><span class="hs-identifier hs-var hs-var">modInfoIface</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe ModIface
</span><a href="GHC.html#minf_iface"><span class="hs-identifier hs-var hs-var">minf_iface</span></a></span><span>
</span><span id="line-1277"></span><span>
</span><span id="line-1278"></span><span class="annot"><a href="GHC.html#modInfoRdrEnv"><span class="hs-identifier hs-type">modInfoRdrEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span>
</span><span id="line-1279"></span><span id="modInfoRdrEnv"><span class="annot"><span class="annottext">modInfoRdrEnv :: ModuleInfo -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.html#modInfoRdrEnv"><span class="hs-identifier hs-var hs-var">modInfoRdrEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.html#minf_rdr_env"><span class="hs-identifier hs-var hs-var">minf_rdr_env</span></a></span><span>
</span><span id="line-1280"></span><span>
</span><span id="line-1281"></span><span class="hs-comment">-- | Retrieve module safe haskell mode</span><span>
</span><span id="line-1282"></span><span class="annot"><a href="GHC.html#modInfoSafe"><span class="hs-identifier hs-type">modInfoSafe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#SafeHaskellMode"><span class="hs-identifier hs-type">SafeHaskellMode</span></a></span><span>
</span><span id="line-1283"></span><span id="modInfoSafe"><span class="annot"><span class="annottext">modInfoSafe :: ModuleInfo -&gt; SafeHaskellMode
</span><a href="GHC.html#modInfoSafe"><span class="hs-identifier hs-var hs-var">modInfoSafe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; SafeHaskellMode
</span><a href="GHC.html#minf_safe"><span class="hs-identifier hs-var hs-var">minf_safe</span></a></span><span>
</span><span id="line-1284"></span><span>
</span><span id="line-1285"></span><span class="annot"><a href="GHC.html#modInfoModBreaks"><span class="hs-identifier hs-type">modInfoModBreaks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.html#ModuleInfo"><span class="hs-identifier hs-type">ModuleInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ModBreaks"><span class="hs-identifier hs-type">ModBreaks</span></a></span><span>
</span><span id="line-1286"></span><span id="modInfoModBreaks"><span class="annot"><span class="annottext">modInfoModBreaks :: ModuleInfo -&gt; ModBreaks
</span><a href="GHC.html#modInfoModBreaks"><span class="hs-identifier hs-var hs-var">modInfoModBreaks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleInfo -&gt; ModBreaks
</span><a href="GHC.html#minf_modBreaks"><span class="hs-identifier hs-var hs-var">minf_modBreaks</span></a></span><span>
</span><span id="line-1287"></span><span>
</span><span id="line-1288"></span><span class="annot"><a href="GHC.html#isDictonaryId"><span class="hs-identifier hs-type">isDictonaryId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1289"></span><span id="isDictonaryId"><span class="annot"><span class="annottext">isDictonaryId :: Var -&gt; Bool
</span><a href="GHC.html#isDictonaryId"><span class="hs-identifier hs-var hs-var">isDictonaryId</span></a></span></span><span> </span><span id="local-6989586621681208118"><span class="annot"><span class="annottext">Var
</span><a href="#local-6989586621681208118"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-1290"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Type -&gt; ([Var], ThetaType, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitSigmaTy"><span class="hs-identifier hs-var">tcSplitSigmaTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Var -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Var
</span><a href="#local-6989586621681208118"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1291"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681208116"><span class="annot"><span class="annottext">[Var]
</span><a href="#local-6989586621681208116"><span class="hs-identifier hs-var">_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208115"><span class="annot"><span class="annottext">ThetaType
</span><a href="#local-6989586621681208115"><span class="hs-identifier hs-var">_theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208114"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681208114"><span class="hs-identifier hs-var">tau</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Predicate.html#isDictTy"><span class="hs-identifier hs-var">isDictTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681208114"><span class="hs-identifier hs-var">tau</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1292"></span><span>
</span><span id="line-1293"></span><span class="hs-comment">-- | Looks up a global name: that is, any top-level name in any</span><span>
</span><span id="line-1294"></span><span class="hs-comment">-- visible module.  Unlike 'lookupName', lookupGlobalName does not use</span><span>
</span><span id="line-1295"></span><span class="hs-comment">-- the interactive context, and therefore does not require a preceding</span><span>
</span><span id="line-1296"></span><span class="hs-comment">-- 'setContext'.</span><span>
</span><span id="line-1297"></span><span id="local-6989586621681209639"><span class="annot"><a href="GHC.html#lookupGlobalName"><span class="hs-identifier hs-type">lookupGlobalName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209639"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209639"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1298"></span><span id="lookupGlobalName"><span class="annot"><span class="annottext">lookupGlobalName :: forall (m :: * -&gt; *). GhcMonad m =&gt; Name -&gt; m (Maybe TyThing)
</span><a href="GHC.html#lookupGlobalName"><span class="hs-identifier hs-var hs-var">lookupGlobalName</span></a></span></span><span> </span><span id="local-6989586621681208107"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208107"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing))
-&gt; (HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208106"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208106"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1299"></span><span>   </span><span class="annot"><span class="annottext">IO (Maybe TyThing) -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe TyThing) -&gt; m (Maybe TyThing))
-&gt; IO (Maybe TyThing) -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO (Maybe TyThing)
</span><a href="GHC.Driver.Types.html#lookupTypeHscEnv"><span class="hs-identifier hs-var">lookupTypeHscEnv</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208106"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208107"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1300"></span><span>
</span><span id="line-1301"></span><span id="local-6989586621681209636"><span id="local-6989586621681209637"><span class="annot"><a href="GHC.html#findGlobalAnns"><span class="hs-identifier hs-type">findGlobalAnns</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209637"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209636"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209636"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Annotations.html#AnnTarget"><span class="hs-identifier hs-type">AnnTarget</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209637"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681209636"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-1302"></span><span id="findGlobalAnns"><span class="annot"><span class="annottext">findGlobalAnns :: forall (m :: * -&gt; *) a.
(GhcMonad m, Typeable a) =&gt;
([Word8] -&gt; a) -&gt; AnnTarget Name -&gt; m [a]
</span><a href="GHC.html#findGlobalAnns"><span class="hs-identifier hs-var hs-var">findGlobalAnns</span></a></span></span><span> </span><span id="local-6989586621681208092"><span class="annot"><span class="annottext">[Word8] -&gt; a
</span><a href="#local-6989586621681208092"><span class="hs-identifier hs-var">deserialize</span></a></span></span><span> </span><span id="local-6989586621681208091"><span class="annot"><span class="annottext">AnnTarget Name
</span><a href="#local-6989586621681208091"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [a]) -&gt; m [a]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [a]) -&gt; m [a]) -&gt; (HscEnv -&gt; m [a]) -&gt; m [a]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208090"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208090"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1303"></span><span>    </span><span id="local-6989586621681208089"><span class="annot"><span class="annottext">AnnEnv
</span><a href="#local-6989586621681208089"><span class="hs-identifier hs-var">ann_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO AnnEnv -&gt; m AnnEnv
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO AnnEnv -&gt; m AnnEnv) -&gt; IO AnnEnv -&gt; m AnnEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Maybe ModGuts -&gt; IO AnnEnv
</span><a href="GHC.Driver.Types.html#prepareAnnotations"><span class="hs-identifier hs-var">prepareAnnotations</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208090"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModGuts
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1304"></span><span>    </span><span class="annot"><span class="annottext">[a] -&gt; m [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([Word8] -&gt; a) -&gt; AnnEnv -&gt; AnnTarget Name -&gt; [a]
forall a.
Typeable a =&gt;
([Word8] -&gt; a) -&gt; AnnEnv -&gt; AnnTarget Name -&gt; [a]
</span><a href="GHC.Types.Annotations.html#findAnns"><span class="hs-identifier hs-var">findAnns</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8] -&gt; a
</span><a href="#local-6989586621681208092"><span class="hs-identifier hs-var">deserialize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnEnv
</span><a href="#local-6989586621681208089"><span class="hs-identifier hs-var">ann_env</span></a></span><span> </span><span class="annot"><span class="annottext">AnnTarget Name
</span><a href="#local-6989586621681208091"><span class="hs-identifier hs-var">target</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1305"></span><span>
</span><span id="line-1306"></span><span class="hs-comment">-- | get the GlobalRdrEnv for a session</span><span>
</span><span id="line-1307"></span><span id="local-6989586621681209630"><span class="annot"><a href="GHC.html#getGRE"><span class="hs-identifier hs-type">getGRE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209630"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209630"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span></span><span>
</span><span id="line-1308"></span><span id="getGRE"><span class="annot"><span class="annottext">getGRE :: forall (m :: * -&gt; *). GhcMonad m =&gt; m GlobalRdrEnv
</span><a href="GHC.html#getGRE"><span class="hs-identifier hs-var hs-var">getGRE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m GlobalRdrEnv) -&gt; m GlobalRdrEnv
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m GlobalRdrEnv) -&gt; m GlobalRdrEnv)
-&gt; (HscEnv -&gt; m GlobalRdrEnv) -&gt; m GlobalRdrEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681208079"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208079"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; m GlobalRdrEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; m GlobalRdrEnv) -&gt; GlobalRdrEnv -&gt; m GlobalRdrEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208079"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1309"></span><span>
</span><span id="line-1310"></span><span class="hs-comment">-- | Retrieve all type and family instances in the environment, indexed</span><span>
</span><span id="line-1311"></span><span class="hs-comment">-- by 'Name'. Each name's lists will contain every instance in which that name</span><span>
</span><span id="line-1312"></span><span class="hs-comment">-- is mentioned in the instance head.</span><span>
</span><span id="line-1313"></span><span id="local-6989586621681209628"><span class="annot"><a href="GHC.html#getNameToInstancesIndex"><span class="hs-identifier hs-type">getNameToInstancesIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209628"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-1314"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- ^ visible modules. An orphan instance will be returned</span><span>
</span><span id="line-1315"></span><span>                     </span><span class="hs-comment">-- if it is visible from at least one module in the list.</span><span>
</span><span id="line-1316"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^ modules to load. If this is not specified, we load</span><span>
</span><span id="line-1317"></span><span>                     </span><span class="hs-comment">-- modules for everything that is in scope unqualified.</span><span>
</span><span id="line-1318"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209628"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier hs-type">FamInst</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-1319"></span><span id="getNameToInstancesIndex"><span class="annot"><span class="annottext">getNameToInstancesIndex :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
[Module]
-&gt; Maybe [Module]
-&gt; m (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
</span><a href="GHC.html#getNameToInstancesIndex"><span class="hs-identifier hs-var hs-var">getNameToInstancesIndex</span></a></span></span><span> </span><span id="local-6989586621681208046"><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681208046"><span class="hs-identifier hs-var">visible_mods</span></a></span></span><span> </span><span id="local-6989586621681208045"><span class="annot"><span class="annottext">Maybe [Module]
</span><a href="#local-6989586621681208045"><span class="hs-identifier hs-var">mods_to_load</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1320"></span><span>  </span><span id="local-6989586621681208044"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208044"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1321"></span><span>  </span><span class="annot"><span class="annottext">IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
-&gt; m (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
 -&gt; m (Messages, Maybe (NameEnv ([ClsInst], [FamInst]))))
-&gt; IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
-&gt; m (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; TcRn (NameEnv ([ClsInst], [FamInst]))
-&gt; IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
forall a. HscEnv -&gt; TcRn a -&gt; IO (Messages, Maybe a)
</span><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier hs-var">runTcInteractive</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208044"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn (NameEnv ([ClsInst], [FamInst]))
 -&gt; IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst]))))
-&gt; TcRn (NameEnv ([ClsInst], [FamInst]))
-&gt; IO (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1322"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe [Module]
</span><a href="#local-6989586621681208045"><span class="hs-identifier hs-var">mods_to_load</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1323"></span><span>           </span><span class="annot"><span class="annottext">Maybe [Module]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Module.html#loadUnqualIfaces"><span class="hs-identifier hs-var">loadUnqualIfaces</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208044"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681208044"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1324"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681208042"><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681208042"><span class="hs-identifier hs-var">mods</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1325"></span><span>             </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208041"><span class="annot"><span class="annottext">doc :: SDoc
</span><a href="#local-6989586621681208041"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Need interface for reporting instances in scope&quot;</span></span><span>
</span><span id="line-1326"></span><span>             </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">IfG () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. IfG a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#initIfaceTcRn"><span class="hs-identifier hs-var">initIfaceTcRn</span></a></span><span> </span><span class="annot"><span class="annottext">(IfG () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IfG () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Module -&gt; IOEnv (Env IfGblEnv ()) ModIface) -&gt; [Module] -&gt; IfG ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Module -&gt; IOEnv (Env IfGblEnv ()) ModIface
forall lcl. SDoc -&gt; Module -&gt; IfM lcl ModIface
</span><a href="GHC.Iface.Load.html#loadSysInterface"><span class="hs-identifier hs-var">loadSysInterface</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681208041"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681208042"><span class="hs-identifier hs-var">mods</span></a></span><span>
</span><span id="line-1327"></span><span>
</span><span id="line-1328"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#InstEnvs"><span class="hs-identifier hs-type">InstEnvs</span></a></span><span> </span><span class="hs-special">{</span><span id="local-6989586621681208038"><span class="annot"><span class="annottext">InstEnv
ie_global :: InstEnvs -&gt; InstEnv
ie_global :: InstEnv
</span><a href="GHC.Core.InstEnv.html#ie_global"><span class="hs-identifier hs-var hs-var">ie_global</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208036"><span class="annot"><span class="annottext">InstEnv
ie_local :: InstEnvs -&gt; InstEnv
ie_local :: InstEnv
</span><a href="GHC.Core.InstEnv.html#ie_local"><span class="hs-identifier hs-var hs-var">ie_local</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM InstEnvs
</span><a href="GHC.Tc.Utils.Env.html#tcGetInstEnvs"><span class="hs-identifier hs-var">tcGetInstEnvs</span></a></span><span>
</span><span id="line-1329"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208033"><span class="annot"><span class="annottext">visible_mods' :: ModuleSet
</span><a href="#local-6989586621681208033"><span class="hs-identifier hs-var hs-var">visible_mods'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Module] -&gt; ModuleSet
</span><a href="GHC.Unit.Module.Env.html#mkModuleSet"><span class="hs-identifier hs-var">mkModuleSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681208046"><span class="hs-identifier hs-var">visible_mods</span></a></span><span>
</span><span id="line-1330"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208031"><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681208031"><span class="hs-identifier hs-var">pkg_fie</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208030"><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681208030"><span class="hs-identifier hs-var">home_fie</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM (FamInstEnv, FamInstEnv)
</span><a href="GHC.Tc.Instance.Family.html#tcGetFamInstEnvs"><span class="hs-identifier hs-var">tcGetFamInstEnvs</span></a></span><span>
</span><span id="line-1331"></span><span>       </span><span class="hs-comment">-- We use Data.Sequence.Seq because we are creating left associated</span><span>
</span><span id="line-1332"></span><span>       </span><span class="hs-comment">-- mappends.</span><span>
</span><span id="line-1333"></span><span>       </span><span class="hs-comment">-- cls_index and fam_index below are adapted from GHC.Tc.Module.lookupInsts</span><span>
</span><span id="line-1334"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208028"><span class="annot"><span class="annottext">cls_index :: Map Name (Seq ClsInst)
</span><a href="#local-6989586621681208028"><span class="hs-identifier hs-var hs-var">cls_index</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Seq ClsInst -&gt; Seq ClsInst -&gt; Seq ClsInst)
-&gt; [(Name, Seq ClsInst)] -&gt; Map Name (Seq ClsInst)
forall k a. Ord k =&gt; (a -&gt; a -&gt; a) -&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#fromListWith"><span class="hs-identifier hs-var">Map.fromListWith</span></a></span><span> </span><span class="annot"><span class="annottext">Seq ClsInst -&gt; Seq ClsInst -&gt; Seq ClsInst
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span>
</span><span id="line-1335"></span><span>                 </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208026"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; Seq ClsInst
forall a. a -&gt; Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#singleton"><span class="hs-identifier hs-var">Seq.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681208024"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1336"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681208024"><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681208024"><span class="hs-identifier hs-var">ispec</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InstEnv -&gt; [ClsInst]
</span><a href="GHC.Core.InstEnv.html#instEnvElts"><span class="hs-identifier hs-var">instEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681208036"><span class="hs-identifier hs-var">ie_local</span></a></span><span> </span><span class="annot"><span class="annottext">[ClsInst] -&gt; [ClsInst] -&gt; [ClsInst]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv -&gt; [ClsInst]
</span><a href="GHC.Core.InstEnv.html#instEnvElts"><span class="hs-identifier hs-var">instEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681208038"><span class="hs-identifier hs-var">ie_global</span></a></span><span>
</span><span id="line-1337"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleSet -&gt; ClsInst -&gt; Bool
</span><a href="GHC.Core.InstEnv.html#instIsVisible"><span class="hs-identifier hs-var">instIsVisible</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSet
</span><a href="#local-6989586621681208033"><span class="hs-identifier hs-var">visible_mods'</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681208024"><span class="hs-identifier hs-var">ispec</span></a></span><span>
</span><span id="line-1338"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208026"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208026"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; [Name]
</span><a href="GHC.Types.Name.Set.html#nameSetElemsStable"><span class="hs-identifier hs-var">nameSetElemsStable</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; [Name]) -&gt; NameSet -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; NameSet
</span><a href="GHC.Core.InstEnv.html#orphNamesOfClsInst"><span class="hs-identifier hs-var">orphNamesOfClsInst</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681208024"><span class="hs-identifier hs-var">ispec</span></a></span><span>
</span><span id="line-1339"></span><span>                 </span><span class="hs-special">]</span><span>
</span><span id="line-1340"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681208019"><span class="annot"><span class="annottext">fam_index :: Map Name (Seq FamInst)
</span><a href="#local-6989586621681208019"><span class="hs-identifier hs-var hs-var">fam_index</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Seq FamInst -&gt; Seq FamInst -&gt; Seq FamInst)
-&gt; [(Name, Seq FamInst)] -&gt; Map Name (Seq FamInst)
forall k a. Ord k =&gt; (a -&gt; a -&gt; a) -&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#fromListWith"><span class="hs-identifier hs-var">Map.fromListWith</span></a></span><span> </span><span class="annot"><span class="annottext">Seq FamInst -&gt; Seq FamInst -&gt; Seq FamInst
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span>
</span><span id="line-1341"></span><span>                 </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208018"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FamInst -&gt; Seq FamInst
forall a. a -&gt; Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#singleton"><span class="hs-identifier hs-var">Seq.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">FamInst
</span><a href="#local-6989586621681208017"><span class="hs-identifier hs-var">fispec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1342"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681208017"><span class="annot"><span class="annottext">FamInst
</span><a href="#local-6989586621681208017"><span class="hs-identifier hs-var">fispec</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FamInstEnv -&gt; [FamInst]
</span><a href="GHC.Core.FamInstEnv.html#famInstEnvElts"><span class="hs-identifier hs-var">famInstEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681208030"><span class="hs-identifier hs-var">home_fie</span></a></span><span> </span><span class="annot"><span class="annottext">[FamInst] -&gt; [FamInst] -&gt; [FamInst]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnv -&gt; [FamInst]
</span><a href="GHC.Core.FamInstEnv.html#famInstEnvElts"><span class="hs-identifier hs-var">famInstEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681208031"><span class="hs-identifier hs-var">pkg_fie</span></a></span><span>
</span><span id="line-1343"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208018"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208018"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; [Name]
</span><a href="GHC.Types.Name.Set.html#nameSetElemsStable"><span class="hs-identifier hs-var">nameSetElemsStable</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; [Name]) -&gt; NameSet -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FamInst -&gt; NameSet
</span><a href="GHC.Core.FVs.html#orphNamesOfFamInst"><span class="hs-identifier hs-var">orphNamesOfFamInst</span></a></span><span> </span><span class="annot"><span class="annottext">FamInst
</span><a href="#local-6989586621681208017"><span class="hs-identifier hs-var">fispec</span></a></span><span>
</span><span id="line-1344"></span><span>                 </span><span class="hs-special">]</span><span>
</span><span id="line-1345"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">NameEnv ([ClsInst], [FamInst])
-&gt; TcRn (NameEnv ([ClsInst], [FamInst]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(NameEnv ([ClsInst], [FamInst])
 -&gt; TcRn (NameEnv ([ClsInst], [FamInst])))
-&gt; NameEnv ([ClsInst], [FamInst])
-&gt; TcRn (NameEnv ([ClsInst], [FamInst]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, ([ClsInst], [FamInst]))] -&gt; NameEnv ([ClsInst], [FamInst])
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([(Name, ([ClsInst], [FamInst]))]
 -&gt; NameEnv ([ClsInst], [FamInst]))
-&gt; [(Name, ([ClsInst], [FamInst]))]
-&gt; NameEnv ([ClsInst], [FamInst])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1346"></span><span>           </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208015"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Seq ClsInst -&gt; [ClsInst]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span> </span><span class="annot"><span class="annottext">Seq ClsInst
</span><a href="#local-6989586621681208013"><span class="hs-identifier hs-var">clss</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Seq FamInst -&gt; [FamInst]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span> </span><span class="annot"><span class="annottext">Seq FamInst
</span><a href="#local-6989586621681208012"><span class="hs-identifier hs-var">fams</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1347"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208015"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681208015"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681208013"><span class="annot"><span class="annottext">Seq ClsInst
</span><a href="#local-6989586621681208013"><span class="hs-identifier hs-var">clss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681208012"><span class="annot"><span class="annottext">Seq FamInst
</span><a href="#local-6989586621681208012"><span class="hs-identifier hs-var">fams</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map Name (Seq ClsInst, Seq FamInst)
-&gt; [(Name, (Seq ClsInst, Seq FamInst))]
forall k a. Map k a -&gt; [(k, a)]
</span><a href="../../containers/src/Data.Map.Internal.html#toList"><span class="hs-identifier hs-var">Map.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(Map Name (Seq ClsInst, Seq FamInst)
 -&gt; [(Name, (Seq ClsInst, Seq FamInst))])
-&gt; Map Name (Seq ClsInst, Seq FamInst)
-&gt; [(Name, (Seq ClsInst, Seq FamInst))]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Seq ClsInst, Seq FamInst)
 -&gt; (Seq ClsInst, Seq FamInst) -&gt; (Seq ClsInst, Seq FamInst))
-&gt; Map Name (Seq ClsInst, Seq FamInst)
-&gt; Map Name (Seq ClsInst, Seq FamInst)
-&gt; Map Name (Seq ClsInst, Seq FamInst)
forall k a. Ord k =&gt; (a -&gt; a -&gt; a) -&gt; Map k a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#unionWith"><span class="hs-identifier hs-var">Map.unionWith</span></a></span><span> </span><span class="annot"><span class="annottext">(Seq ClsInst, Seq FamInst)
-&gt; (Seq ClsInst, Seq FamInst) -&gt; (Seq ClsInst, Seq FamInst)
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span>
</span><span id="line-1348"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Seq ClsInst -&gt; (Seq ClsInst, Seq FamInst))
-&gt; Map Name (Seq ClsInst) -&gt; Map Name (Seq ClsInst, Seq FamInst)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span class="annot"><span class="annottext">Seq FamInst
forall a. Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#empty"><span class="hs-identifier hs-var">Seq.empty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map Name (Seq ClsInst)
</span><a href="#local-6989586621681208028"><span class="hs-identifier hs-var">cls_index</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1349"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Seq FamInst -&gt; (Seq ClsInst, Seq FamInst))
-&gt; Map Name (Seq FamInst) -&gt; Map Name (Seq ClsInst, Seq FamInst)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Seq ClsInst
forall a. Seq a
</span><a href="../../containers/src/Data.Sequence.Internal.html#empty"><span class="hs-identifier hs-var">Seq.empty</span></a></span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map Name (Seq FamInst)
</span><a href="#local-6989586621681208019"><span class="hs-identifier hs-var">fam_index</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1350"></span><span>           </span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1351"></span><span>
</span><span id="line-1352"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1353"></span><span>
</span><span id="line-1354"></span><span class="hs-comment">{- ToDo: Move the primary logic here to &quot;GHC.Unit.State&quot;
-- | Return all /external/ modules available in the package database.
-- Modules from the current session (i.e., from the 'HomePackageTable') are
-- not included.  This includes module names which are reexported by packages.
packageDbModules :: GhcMonad m =&gt;
                    Bool  -- ^ Only consider exposed packages.
                 -&gt; m [Module]
packageDbModules only_exposed = do
   dflags &lt;- getSessionDynFlags
   let pkgs = eltsUFM (unitInfoMap (unitState dflags))
   return $
     [ mkModule pid modname
     | p &lt;- pkgs
     , not only_exposed || exposed p
     , let pid = mkUnit p
     , modname &lt;- exposedModules p
               ++ map exportName (reexportedModules p) ]
               -}</span><span>
</span><span id="line-1372"></span><span>
</span><span id="line-1373"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1374"></span><span class="hs-comment">-- Misc exported utils</span><span>
</span><span id="line-1375"></span><span>
</span><span id="line-1376"></span><span class="annot"><a href="GHC.html#dataConType"><span class="hs-identifier hs-type">dataConType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1377"></span><span id="dataConType"><span class="annot"><span class="annottext">dataConType :: DataCon -&gt; Type
</span><a href="GHC.html#dataConType"><span class="hs-identifier hs-var hs-var">dataConType</span></a></span></span><span> </span><span id="local-6989586621681208008"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681208008"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Var -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Var
</span><a href="GHC.Core.DataCon.html#dataConWrapId"><span class="hs-identifier hs-var">dataConWrapId</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681208008"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1378"></span><span>
</span><span id="line-1379"></span><span class="hs-comment">-- | print a 'NamedThing', adding parentheses if the name is an operator.</span><span>
</span><span id="line-1380"></span><span id="local-6989586621681209585"><span class="annot"><a href="GHC.html#pprParenSymName"><span class="hs-identifier hs-type">pprParenSymName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#NamedThing"><span class="hs-identifier hs-type">NamedThing</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209585"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209585"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-1381"></span><span id="pprParenSymName"><span class="annot"><span class="annottext">pprParenSymName :: forall a. NamedThing a =&gt; a -&gt; SDoc
</span><a href="GHC.html#pprParenSymName"><span class="hs-identifier hs-var hs-var">pprParenSymName</span></a></span></span><span> </span><span id="local-6989586621681208001"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681208001"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Types.Name.Occurrence.html#parenSymOcc"><span class="hs-identifier hs-var">parenSymOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681208001"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681208001"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1382"></span><span>
</span><span id="line-1383"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-1384"></span><span>
</span><span id="line-1385"></span><span>
</span><span id="line-1386"></span><span class="hs-comment">-- ToDo:</span><span>
</span><span id="line-1387"></span><span class="hs-comment">--   - Data and Typeable instances for HsSyn.</span><span>
</span><span id="line-1388"></span><span>
</span><span id="line-1389"></span><span class="hs-comment">-- ToDo: check for small transformations that happen to the syntax in</span><span>
</span><span id="line-1390"></span><span class="hs-comment">-- the typechecker (eg. -e ==&gt; negate e, perhaps for fromIntegral)</span><span>
</span><span id="line-1391"></span><span>
</span><span id="line-1392"></span><span class="hs-comment">-- ToDo: maybe use TH syntax instead of Iface syntax?  There's already a way</span><span>
</span><span id="line-1393"></span><span class="hs-comment">-- to get from TyCons, Ids etc. to TH syntax (reify).</span><span>
</span><span id="line-1394"></span><span>
</span><span id="line-1395"></span><span class="hs-comment">-- :browse will use either lm_toplev or inspect lm_interface, depending</span><span>
</span><span id="line-1396"></span><span class="hs-comment">-- on whether the module is interpreted or not.</span><span>
</span><span id="line-1397"></span><span>
</span><span id="line-1398"></span><span>
</span><span id="line-1399"></span><span class="hs-comment">-- Extract the filename, stringbuffer content and dynflags associed to a module</span><span>
</span><span id="line-1400"></span><span class="hs-comment">--</span><span>
</span><span id="line-1401"></span><span class="hs-comment">-- XXX: Explain pre-conditions</span><span>
</span><span id="line-1402"></span><span id="local-6989586621681209580"><span class="annot"><a href="GHC.html#getModuleSourceAndFlags"><span class="hs-identifier hs-type">getModuleSourceAndFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209580"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209580"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html#StringBuffer"><span class="hs-identifier hs-type">StringBuffer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1403"></span><span id="getModuleSourceAndFlags"><span class="annot"><span class="annottext">getModuleSourceAndFlags :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Module -&gt; m (FilePath, InputFileBuffer, DynFlags)
</span><a href="GHC.html#getModuleSourceAndFlags"><span class="hs-identifier hs-var hs-var">getModuleSourceAndFlags</span></a></span></span><span> </span><span id="local-6989586621681207978"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207978"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1404"></span><span>  </span><span id="local-6989586621681207977"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681207977"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; m ModSummary
forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m ModSummary
</span><a href="GHC.html#getModSummary"><span class="hs-identifier hs-var">getModSummary</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207978"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1405"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">(ModLocation -&gt; Maybe FilePath) -&gt; ModLocation -&gt; Maybe FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; ModLocation
</span><a href="GHC.Driver.Types.html#ms_location"><span class="hs-identifier hs-var hs-var">ms_location</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681207977"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1406"></span><span>    </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681207975"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207975"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-1407"></span><span>                  </span><span class="annot"><span class="annottext">IO (FilePath, InputFileBuffer, DynFlags)
-&gt; m (FilePath, InputFileBuffer, DynFlags)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (FilePath, InputFileBuffer, DynFlags)
 -&gt; m (FilePath, InputFileBuffer, DynFlags))
-&gt; IO (FilePath, InputFileBuffer, DynFlags)
-&gt; m (FilePath, InputFileBuffer, DynFlags)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcApiError -&gt; IO (FilePath, InputFileBuffer, DynFlags)
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcApiError -&gt; IO (FilePath, InputFileBuffer, DynFlags))
-&gt; GhcApiError -&gt; IO (FilePath, InputFileBuffer, DynFlags)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; GhcApiError
</span><a href="GHC.Driver.Types.html#mkApiErr"><span class="hs-identifier hs-var">mkApiErr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207975"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;No source available for module &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207978"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1408"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207974"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207974"><span class="hs-identifier hs-var">sourceFile</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1409"></span><span>        </span><span id="local-6989586621681207973"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207973"><span class="hs-identifier hs-var">source</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO InputFileBuffer -&gt; m InputFileBuffer
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO InputFileBuffer -&gt; m InputFileBuffer)
-&gt; IO InputFileBuffer -&gt; m InputFileBuffer
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO InputFileBuffer
</span><a href="GHC.Data.StringBuffer.html#hGetStringBuffer"><span class="hs-identifier hs-var">hGetStringBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207974"><span class="hs-identifier hs-var">sourceFile</span></a></span><span>
</span><span id="line-1410"></span><span>        </span><span class="annot"><span class="annottext">(FilePath, InputFileBuffer, DynFlags)
-&gt; m (FilePath, InputFileBuffer, DynFlags)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207974"><span class="hs-identifier hs-var">sourceFile</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207973"><span class="hs-identifier hs-var">source</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var hs-var">ms_hspp_opts</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681207977"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1411"></span><span>
</span><span id="line-1412"></span><span>
</span><span id="line-1413"></span><span class="hs-comment">-- | Return module source as token stream, including comments.</span><span>
</span><span id="line-1414"></span><span class="hs-comment">--</span><span>
</span><span id="line-1415"></span><span class="hs-comment">-- The module must be in the module graph and its source must be available.</span><span>
</span><span id="line-1416"></span><span class="hs-comment">-- Throws a 'GHC.Driver.Types.SourceError' on parse error.</span><span>
</span><span id="line-1417"></span><span id="local-6989586621681209578"><span class="annot"><a href="GHC.html#getTokenStream"><span class="hs-identifier hs-type">getTokenStream</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209578"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209578"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1418"></span><span id="getTokenStream"><span class="annot"><span class="annottext">getTokenStream :: forall (m :: * -&gt; *). GhcMonad m =&gt; Module -&gt; m [Located Token]
</span><a href="GHC.html#getTokenStream"><span class="hs-identifier hs-var hs-var">getTokenStream</span></a></span></span><span> </span><span id="local-6989586621681207958"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207958"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1419"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681207957"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207957"><span class="hs-identifier hs-var">sourceFile</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207956"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207956"><span class="hs-identifier hs-var">source</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207955"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207955"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Module -&gt; m (FilePath, InputFileBuffer, DynFlags)
forall (m :: * -&gt; *).
GhcMonad m =&gt;
Module -&gt; m (FilePath, InputFileBuffer, DynFlags)
</span><a href="GHC.html#getModuleSourceAndFlags"><span class="hs-identifier hs-var">getModuleSourceAndFlags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207958"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-1420"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681207954"><span class="annot"><span class="annottext">startLoc :: RealSrcLoc
</span><a href="#local-6989586621681207954"><span class="hs-identifier hs-var hs-var">startLoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207957"><span class="hs-identifier hs-var">sourceFile</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1421"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
-&gt; RealSrcLoc -&gt; DynFlags -&gt; ParseResult [Located Token]
</span><a href="GHC.Parser.Lexer.html#lexTokenStream"><span class="hs-identifier hs-var">lexTokenStream</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207956"><span class="hs-identifier hs-var">source</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207954"><span class="hs-identifier hs-var">startLoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207955"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1422"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681207949"><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207949"><span class="hs-identifier hs-var">ts</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Located Token] -&gt; m [Located Token]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207949"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1423"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">PFailed</span></a></span><span> </span><span id="local-6989586621681207947"><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207947"><span class="hs-identifier hs-var">pst</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1424"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681207946"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207946"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-1425"></span><span>           </span><span class="annot"><span class="annottext">Bag WarnMsg -&gt; m [Located Token]
forall (io :: * -&gt; *) a. MonadIO io =&gt; Bag WarnMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwErrors"><span class="hs-identifier hs-var">throwErrors</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PState -&gt; DynFlags -&gt; Bag WarnMsg
</span><a href="GHC.Parser.Lexer.html#getErrorMessages"><span class="hs-identifier hs-var">getErrorMessages</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207947"><span class="hs-identifier hs-var">pst</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207946"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1426"></span><span>
</span><span id="line-1427"></span><span class="hs-comment">-- | Give even more information on the source than 'getTokenStream'</span><span>
</span><span id="line-1428"></span><span class="hs-comment">-- This function allows reconstructing the source completely with</span><span>
</span><span id="line-1429"></span><span class="hs-comment">-- 'showRichTokenStream'.</span><span>
</span><span id="line-1430"></span><span id="local-6989586621681209570"><span class="annot"><a href="GHC.html#getRichTokenStream"><span class="hs-identifier hs-type">getRichTokenStream</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209570"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209570"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-1431"></span><span id="getRichTokenStream"><span class="annot"><span class="annottext">getRichTokenStream :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Module -&gt; m [(Located Token, FilePath)]
</span><a href="GHC.html#getRichTokenStream"><span class="hs-identifier hs-var hs-var">getRichTokenStream</span></a></span></span><span> </span><span id="local-6989586621681207930"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207930"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1432"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681207929"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207929"><span class="hs-identifier hs-var">sourceFile</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207928"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207928"><span class="hs-identifier hs-var">source</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207927"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207927"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Module -&gt; m (FilePath, InputFileBuffer, DynFlags)
forall (m :: * -&gt; *).
GhcMonad m =&gt;
Module -&gt; m (FilePath, InputFileBuffer, DynFlags)
</span><a href="GHC.html#getModuleSourceAndFlags"><span class="hs-identifier hs-var">getModuleSourceAndFlags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207930"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-1433"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681207926"><span class="annot"><span class="annottext">startLoc :: RealSrcLoc
</span><a href="#local-6989586621681207926"><span class="hs-identifier hs-var hs-var">startLoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207929"><span class="hs-identifier hs-var">sourceFile</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1434"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
-&gt; RealSrcLoc -&gt; DynFlags -&gt; ParseResult [Located Token]
</span><a href="GHC.Parser.Lexer.html#lexTokenStream"><span class="hs-identifier hs-var">lexTokenStream</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207928"><span class="hs-identifier hs-var">source</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207926"><span class="hs-identifier hs-var">startLoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207927"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1435"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681207925"><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207925"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[(Located Token, FilePath)] -&gt; m [(Located Token, FilePath)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([(Located Token, FilePath)] -&gt; m [(Located Token, FilePath)])
-&gt; [(Located Token, FilePath)] -&gt; m [(Located Token, FilePath)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; InputFileBuffer
-&gt; [Located Token]
-&gt; [(Located Token, FilePath)]
</span><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-var">addSourceToTokens</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207926"><span class="hs-identifier hs-var">startLoc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207928"><span class="hs-identifier hs-var">source</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207925"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1436"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">PFailed</span></a></span><span> </span><span id="local-6989586621681207924"><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207924"><span class="hs-identifier hs-var">pst</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1437"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681207923"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207923"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-1438"></span><span>           </span><span class="annot"><span class="annottext">Bag WarnMsg -&gt; m [(Located Token, FilePath)]
forall (io :: * -&gt; *) a. MonadIO io =&gt; Bag WarnMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwErrors"><span class="hs-identifier hs-var">throwErrors</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PState -&gt; DynFlags -&gt; Bag WarnMsg
</span><a href="GHC.Parser.Lexer.html#getErrorMessages"><span class="hs-identifier hs-var">getErrorMessages</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207924"><span class="hs-identifier hs-var">pst</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207923"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1439"></span><span>
</span><span id="line-1440"></span><span class="hs-comment">-- | Given a source location and a StringBuffer corresponding to this</span><span>
</span><span id="line-1441"></span><span class="hs-comment">-- location, return a rich token stream with the source associated to the</span><span>
</span><span id="line-1442"></span><span class="hs-comment">-- tokens.</span><span>
</span><span id="line-1443"></span><span class="annot"><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-type">addSourceToTokens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcLoc"><span class="hs-identifier hs-type">RealSrcLoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html#StringBuffer"><span class="hs-identifier hs-type">StringBuffer</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1444"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1445"></span><span id="addSourceToTokens"><span class="annot"><span class="annottext">addSourceToTokens :: RealSrcLoc
-&gt; InputFileBuffer
-&gt; [Located Token]
-&gt; [(Located Token, FilePath)]
</span><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-var hs-var">addSourceToTokens</span></a></span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1446"></span><span class="annot"><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-var">addSourceToTokens</span></a></span><span> </span><span id="local-6989586621681207922"><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207922"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681207921"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207921"><span class="hs-identifier hs-var">buf</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681207920"><span class="annot"><span class="annottext">t :: Located Token
</span><a href="#local-6989586621681207920"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681207918"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681207918"><span class="hs-identifier hs-var">span</span></a></span></span><span> </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681207917"><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207917"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1447"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681207918"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1448"></span><span>      </span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Token
</span><a href="#local-6989586621681207920"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Located Token, FilePath)
-&gt; [(Located Token, FilePath)] -&gt; [(Located Token, FilePath)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; InputFileBuffer
-&gt; [Located Token]
-&gt; [(Located Token, FilePath)]
</span><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-var">addSourceToTokens</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207922"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207921"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207917"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1449"></span><span>      </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621681207914"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207914"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Token
</span><a href="#local-6989586621681207920"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207913"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Located Token, FilePath)
-&gt; [(Located Token, FilePath)] -&gt; [(Located Token, FilePath)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; InputFileBuffer
-&gt; [Located Token]
-&gt; [(Located Token, FilePath)]
</span><a href="GHC.html#addSourceToTokens"><span class="hs-identifier hs-var">addSourceToTokens</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207912"><span class="hs-identifier hs-var">newLoc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207911"><span class="hs-identifier hs-var">newBuf</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Token]
</span><a href="#local-6989586621681207917"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1450"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-1451"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681207912"><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207912"><span class="hs-identifier hs-var">newLoc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207911"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207911"><span class="hs-identifier hs-var">newBuf</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207913"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207913"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
-&gt; RealSrcLoc
-&gt; InputFileBuffer
-&gt; (RealSrcLoc, InputFileBuffer, FilePath)
</span><a href="#local-6989586621681207910"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207922"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207921"><span class="hs-identifier hs-var">buf</span></a></span><span>
</span><span id="line-1452"></span><span>          </span><span id="local-6989586621681207909"><span class="annot"><span class="annottext">start :: RealSrcLoc
</span><a href="#local-6989586621681207909"><span class="hs-identifier hs-var hs-var">start</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#realSrcSpanStart"><span class="hs-identifier hs-var">realSrcSpanStart</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207914"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1453"></span><span>          </span><span id="local-6989586621681207907"><span class="annot"><span class="annottext">end :: RealSrcLoc
</span><a href="#local-6989586621681207907"><span class="hs-identifier hs-var hs-var">end</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#realSrcSpanEnd"><span class="hs-identifier hs-var">realSrcSpanEnd</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207914"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1454"></span><span>          </span><span id="local-6989586621681207910"><span class="annot"><span class="annottext">go :: FilePath
-&gt; RealSrcLoc
-&gt; InputFileBuffer
-&gt; (RealSrcLoc, InputFileBuffer, FilePath)
</span><a href="#local-6989586621681207910"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681207905"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207905"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621681207904"><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681207903"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207903"><span class="hs-identifier hs-var">buf</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; RealSrcLoc -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207909"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
-&gt; RealSrcLoc
-&gt; InputFileBuffer
-&gt; (RealSrcLoc, InputFileBuffer, FilePath)
</span><a href="#local-6989586621681207910"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207905"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207901"><span class="hs-identifier hs-var">nLoc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207900"><span class="hs-identifier hs-var">nBuf</span></a></span><span>
</span><span id="line-1455"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207909"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; RealSrcLoc -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; RealSrcLoc -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207907"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
-&gt; RealSrcLoc
-&gt; InputFileBuffer
-&gt; (RealSrcLoc, InputFileBuffer, FilePath)
</span><a href="#local-6989586621681207910"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681207897"><span class="hs-identifier hs-var">ch</span></a></span><span class="annot"><span class="annottext">Char -&gt; FilePath -&gt; FilePath
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207905"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207901"><span class="hs-identifier hs-var">nLoc</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207900"><span class="hs-identifier hs-var">nBuf</span></a></span><span>
</span><span id="line-1456"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207903"><span class="hs-identifier hs-var">buf</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207905"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1457"></span><span>              </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681207897"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681207897"><span class="hs-identifier hs-var">ch</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207900"><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207900"><span class="hs-identifier hs-var">nBuf</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InputFileBuffer -&gt; (Char, InputFileBuffer)
</span><a href="GHC.Data.StringBuffer.html#nextChar"><span class="hs-identifier hs-var">nextChar</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207903"><span class="hs-identifier hs-var">buf</span></a></span><span>
</span><span id="line-1458"></span><span>                    </span><span id="local-6989586621681207901"><span class="annot"><span class="annottext">nLoc :: RealSrcLoc
</span><a href="#local-6989586621681207901"><span class="hs-identifier hs-var hs-var">nLoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; Char -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#advanceSrcLoc"><span class="hs-identifier hs-var">advanceSrcLoc</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207904"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681207897"><span class="hs-identifier hs-var">ch</span></a></span><span>
</span><span id="line-1459"></span><span>
</span><span id="line-1460"></span><span>
</span><span id="line-1461"></span><span class="hs-comment">-- | Take a rich token stream such as produced from 'getRichTokenStream' and</span><span>
</span><span id="line-1462"></span><span class="hs-comment">-- return source code almost identical to the original code (except for</span><span>
</span><span id="line-1463"></span><span class="hs-comment">-- insignificant whitespace.)</span><span>
</span><span id="line-1464"></span><span class="annot"><a href="GHC.html#showRichTokenStream"><span class="hs-identifier hs-type">showRichTokenStream</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1465"></span><span id="showRichTokenStream"><span class="annot"><span class="annottext">showRichTokenStream :: [(Located Token, FilePath)] -&gt; FilePath
</span><a href="GHC.html#showRichTokenStream"><span class="hs-identifier hs-var hs-var">showRichTokenStream</span></a></span></span><span> </span><span id="local-6989586621681207893"><span class="annot"><span class="annottext">[(Located Token, FilePath)]
</span><a href="#local-6989586621681207893"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; [(Located Token, FilePath)] -&gt; FilePath -&gt; FilePath
forall {e}.
RealSrcLoc
-&gt; [(GenLocated SrcSpan e, FilePath)] -&gt; FilePath -&gt; FilePath
</span><a href="#local-6989586621681207892"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207891"><span class="hs-identifier hs-var">startLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[(Located Token, FilePath)]
</span><a href="#local-6989586621681207893"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-1466"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681207890"><span class="annot"><span class="annottext">sourceFile :: FastString
</span><a href="#local-6989586621681207890"><span class="hs-identifier hs-var hs-var">sourceFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SrcSpan] -&gt; FastString
</span><a href="#local-6989586621681207889"><span class="hs-identifier hs-var">getFile</span></a></span><span> </span><span class="annot"><span class="annottext">([SrcSpan] -&gt; FastString) -&gt; [SrcSpan] -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Located Token, FilePath) -&gt; SrcSpan)
-&gt; [(Located Token, FilePath)] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Token -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Located Token -&gt; SrcSpan)
-&gt; ((Located Token, FilePath) -&gt; Located Token)
-&gt; (Located Token, FilePath)
-&gt; SrcSpan
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Located Token, FilePath) -&gt; Located Token
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Located Token, FilePath)]
</span><a href="#local-6989586621681207893"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1467"></span><span>          </span><span id="local-6989586621681207889"><span class="annot"><span class="annottext">getFile :: [SrcSpan] -&gt; FastString
</span><a href="#local-6989586621681207889"><span class="hs-identifier hs-var hs-var">getFile</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FastString
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;showRichTokenStream: No source file found&quot;</span></span><span>
</span><span id="line-1468"></span><span>          </span><span class="annot"><a href="#local-6989586621681207889"><span class="hs-identifier hs-var">getFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681207888"><span class="annot"><span class="annottext">[SrcSpan]
</span><a href="#local-6989586621681207888"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SrcSpan] -&gt; FastString
</span><a href="#local-6989586621681207889"><span class="hs-identifier hs-var">getFile</span></a></span><span> </span><span class="annot"><span class="annottext">[SrcSpan]
</span><a href="#local-6989586621681207888"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1469"></span><span>          </span><span class="annot"><a href="#local-6989586621681207889"><span class="hs-identifier hs-var">getFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621681207887"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207887"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[SrcSpan]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; FastString
</span><a href="GHC.Types.SrcLoc.html#srcSpanFile"><span class="hs-identifier hs-var hs-var">srcSpanFile</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207887"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1470"></span><span>          </span><span id="local-6989586621681207891"><span class="annot"><span class="annottext">startLoc :: RealSrcLoc
</span><a href="#local-6989586621681207891"><span class="hs-identifier hs-var hs-var">startLoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207890"><span class="hs-identifier hs-var">sourceFile</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1471"></span><span>          </span><span id="local-6989586621681207892"><span class="annot"><span class="annottext">go :: RealSrcLoc
-&gt; [(GenLocated SrcSpan e, FilePath)] -&gt; FilePath -&gt; FilePath
</span><a href="#local-6989586621681207892"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1472"></span><span>          </span><span class="annot"><a href="#local-6989586621681207892"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681207879"><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207879"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681207878"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681207878"><span class="hs-identifier hs-var">span</span></a></span></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207877"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207877"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681207876"><span class="annot"><span class="annottext">[(GenLocated SrcSpan e, FilePath)]
</span><a href="#local-6989586621681207876"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1473"></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681207878"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1474"></span><span>                </span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; [(GenLocated SrcSpan e, FilePath)] -&gt; FilePath -&gt; FilePath
</span><a href="#local-6989586621681207892"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207879"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenLocated SrcSpan e, FilePath)]
</span><a href="#local-6989586621681207876"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1475"></span><span>                </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621681207875"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207875"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-1476"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207874"><span class="hs-identifier hs-var">locLine</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207873"><span class="hs-identifier hs-var">tokLine</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207871"><span class="hs-identifier hs-var">tokCol</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207870"><span class="hs-identifier hs-var">locCol</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1477"></span><span>                                       </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207877"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1478"></span><span>                                       </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; [(GenLocated SrcSpan e, FilePath)] -&gt; FilePath -&gt; FilePath
</span><a href="#local-6989586621681207892"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207869"><span class="hs-identifier hs-var">tokEnd</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenLocated SrcSpan e, FilePath)]
</span><a href="#local-6989586621681207876"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1479"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207873"><span class="hs-identifier hs-var">tokLine</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207874"><span class="hs-identifier hs-var">locLine</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1480"></span><span>                               </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207871"><span class="hs-identifier hs-var">tokCol</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1481"></span><span>                              </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207877"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1482"></span><span>                              </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
-&gt; [(GenLocated SrcSpan e, FilePath)] -&gt; FilePath -&gt; FilePath
</span><a href="#local-6989586621681207892"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207869"><span class="hs-identifier hs-var">tokEnd</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenLocated SrcSpan e, FilePath)]
</span><a href="#local-6989586621681207876"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1483"></span><span>                  </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681207874"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207874"><span class="hs-identifier hs-var">locLine</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207870"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207870"><span class="hs-identifier hs-var">locCol</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcLoc -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcLocLine"><span class="hs-identifier hs-var">srcLocLine</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207879"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcLocCol"><span class="hs-identifier hs-var">srcLocCol</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207879"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1484"></span><span>                        </span><span class="hs-special">(</span><span id="local-6989586621681207873"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207873"><span class="hs-identifier hs-var">tokLine</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207871"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207871"><span class="hs-identifier hs-var">tokCol</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanStartLine"><span class="hs-identifier hs-var">srcSpanStartLine</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207875"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanStartCol"><span class="hs-identifier hs-var">srcSpanStartCol</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207875"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1485"></span><span>                        </span><span id="local-6989586621681207869"><span class="annot"><span class="annottext">tokEnd :: RealSrcLoc
</span><a href="#local-6989586621681207869"><span class="hs-identifier hs-var hs-var">tokEnd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#realSrcSpanEnd"><span class="hs-identifier hs-var">realSrcSpanEnd</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681207875"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1486"></span><span>
</span><span id="line-1487"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1488"></span><span class="hs-comment">-- Interactive evaluation</span><span>
</span><span id="line-1489"></span><span>
</span><span id="line-1490"></span><span class="hs-comment">-- | Takes a 'ModuleName' and possibly a 'UnitId', and consults the</span><span>
</span><span id="line-1491"></span><span class="hs-comment">-- filesystem and package database to find the corresponding 'Module',</span><span>
</span><span id="line-1492"></span><span class="hs-comment">-- using the algorithm that is used for an @import@ declaration.</span><span>
</span><span id="line-1493"></span><span id="local-6989586621681209557"><span class="annot"><a href="GHC.html#findModule"><span class="hs-identifier hs-type">findModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209557"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209557"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span></span><span>
</span><span id="line-1494"></span><span id="findModule"><span class="annot"><span class="annottext">findModule :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
ModuleName -&gt; Maybe FastString -&gt; m Module
</span><a href="GHC.html#findModule"><span class="hs-identifier hs-var hs-var">findModule</span></a></span></span><span> </span><span id="local-6989586621681207845"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621681207844"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681207844"><span class="hs-identifier hs-var">maybe_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Module) -&gt; m Module
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Module) -&gt; m Module)
-&gt; (HscEnv -&gt; m Module) -&gt; m Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207843"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207843"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1495"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-1496"></span><span>    </span><span id="local-6989586621681207842"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681207842"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207843"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1497"></span><span>    </span><span id="local-6989586621681207841"><span class="annot"><span class="annottext">this_pkg :: Unit
</span><a href="#local-6989586621681207841"><span class="hs-identifier hs-var hs-var">this_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207842"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1498"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1499"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681207844"><span class="hs-identifier hs-var">maybe_pkg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1500"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207839"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207839"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Unit
</span><a href="GHC.Unit.Types.html#fsToUnit"><span class="hs-identifier hs-var">fsToUnit</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207839"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Unit -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681207841"><span class="hs-identifier hs-var">this_pkg</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207839"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;this&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO Module -&gt; m Module
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Module -&gt; m Module) -&gt; IO Module -&gt; m Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1501"></span><span>      </span><span id="local-6989586621681207836"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207836"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-var">findImportedModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207843"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681207844"><span class="hs-identifier hs-var">maybe_pkg</span></a></span><span>
</span><span id="line-1502"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207836"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1503"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-type">Found</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681207833"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207833"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; IO Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207833"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1504"></span><span>        </span><span id="local-6989586621681207832"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207832"><span class="hs-identifier hs-var">err</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WarnMsg -&gt; IO Module
forall (io :: * -&gt; *) a. MonadIO io =&gt; WarnMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwOneError"><span class="hs-identifier hs-var">throwOneError</span></a></span><span> </span><span class="annot"><span class="annottext">(WarnMsg -&gt; IO Module) -&gt; WarnMsg -&gt; IO Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; ModuleName -&gt; FindResult -&gt; WarnMsg
</span><a href="GHC.Driver.Make.html#noModError"><span class="hs-identifier hs-var">noModError</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207842"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207832"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-1505"></span><span>    </span><span id="local-6989586621681207829"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681207829"><span class="hs-identifier hs-var">_otherwise</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1506"></span><span>      </span><span id="local-6989586621681207828"><span class="annot"><span class="annottext">Maybe Module
</span><a href="#local-6989586621681207828"><span class="hs-identifier hs-var">home</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; m (Maybe Module)
forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m (Maybe Module)
</span><a href="GHC.html#lookupLoadedHomeModule"><span class="hs-identifier hs-var">lookupLoadedHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-1507"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="#local-6989586621681207828"><span class="hs-identifier hs-var">home</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1508"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207826"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207826"><span class="hs-identifier hs-var">m</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; m Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207826"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1509"></span><span>        </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO Module -&gt; m Module
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Module -&gt; m Module) -&gt; IO Module -&gt; m Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1510"></span><span>           </span><span id="local-6989586621681207825"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207825"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-var">findImportedModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207843"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681207844"><span class="hs-identifier hs-var">maybe_pkg</span></a></span><span>
</span><span id="line-1511"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207825"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1512"></span><span>             </span><span class="annot"><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-type">Found</span></a></span><span> </span><span id="local-6989586621681207824"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681207824"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681207823"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207823"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207823"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Unit -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681207841"><span class="hs-identifier hs-var">this_pkg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; IO Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207823"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1513"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Module -&gt; ModLocation -&gt; IO Module
forall a. DynFlags -&gt; Module -&gt; ModLocation -&gt; IO a
</span><a href="GHC.html#modNotLoadedError"><span class="hs-identifier hs-var">modNotLoadedError</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207842"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207823"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681207824"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-1514"></span><span>             </span><span id="local-6989586621681207821"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207821"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WarnMsg -&gt; IO Module
forall (io :: * -&gt; *) a. MonadIO io =&gt; WarnMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwOneError"><span class="hs-identifier hs-var">throwOneError</span></a></span><span> </span><span class="annot"><span class="annottext">(WarnMsg -&gt; IO Module) -&gt; WarnMsg -&gt; IO Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; ModuleName -&gt; FindResult -&gt; WarnMsg
</span><a href="GHC.Driver.Make.html#noModError"><span class="hs-identifier hs-var">noModError</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207842"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207845"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207821"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-1515"></span><span>
</span><span id="line-1516"></span><span id="local-6989586621681209549"><span class="annot"><a href="GHC.html#modNotLoadedError"><span class="hs-identifier hs-type">modNotLoadedError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681209549"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1517"></span><span id="modNotLoadedError"><span class="annot"><span class="annottext">modNotLoadedError :: forall a. DynFlags -&gt; Module -&gt; ModLocation -&gt; IO a
</span><a href="GHC.html#modNotLoadedError"><span class="hs-identifier hs-var hs-var">modNotLoadedError</span></a></span></span><span> </span><span id="local-6989586621681207816"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207816"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681207815"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207815"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621681207814"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681207814"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO a
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcException -&gt; IO a) -&gt; GhcException -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#CmdLineError"><span class="hs-identifier hs-var">CmdLineError</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; GhcException) -&gt; FilePath -&gt; GhcException
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207816"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; FilePath) -&gt; SDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1518"></span><span>   </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;module is not loaded:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-1519"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207815"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-1520"></span><span>   </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath -&gt; FilePath
forall a. HasCallStack =&gt; FilePath -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;modNotLoadedError&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681207814"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1521"></span><span>
</span><span id="line-1522"></span><span class="hs-comment">-- | Like 'findModule', but differs slightly when the module refers to</span><span>
</span><span id="line-1523"></span><span class="hs-comment">-- a source file, and the file has not been loaded via 'load'.  In</span><span>
</span><span id="line-1524"></span><span class="hs-comment">-- this case, 'findModule' will throw an error (module not loaded),</span><span>
</span><span id="line-1525"></span><span class="hs-comment">-- but 'lookupModule' will check to see whether the module can also be</span><span>
</span><span id="line-1526"></span><span class="hs-comment">-- found in a package, and if so, that package 'Module' will be</span><span>
</span><span id="line-1527"></span><span class="hs-comment">-- returned.  If not, the usual module-not-found error will be thrown.</span><span>
</span><span id="line-1528"></span><span class="hs-comment">--</span><span>
</span><span id="line-1529"></span><span id="local-6989586621681207811"><span class="annot"><a href="GHC.html#lookupModule"><span class="hs-identifier hs-type">lookupModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681207811"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681207811"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span></span><span>
</span><span id="line-1530"></span><span id="lookupModule"><span class="annot"><span class="annottext">lookupModule :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
ModuleName -&gt; Maybe FastString -&gt; m Module
</span><a href="GHC.html#lookupModule"><span class="hs-identifier hs-var hs-var">lookupModule</span></a></span></span><span> </span><span id="local-6989586621681207795"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207795"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207794"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207794"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Maybe FastString -&gt; m Module
forall (m :: * -&gt; *).
GhcMonad m =&gt;
ModuleName -&gt; Maybe FastString -&gt; m Module
</span><a href="GHC.html#findModule"><span class="hs-identifier hs-var">findModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207795"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Maybe FastString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681207794"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1531"></span><span class="annot"><a href="GHC.html#lookupModule"><span class="hs-identifier hs-var">lookupModule</span></a></span><span> </span><span id="local-6989586621681207793"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207793"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Module) -&gt; m Module
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Module) -&gt; m Module)
-&gt; (HscEnv -&gt; m Module) -&gt; m Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207792"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207792"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1532"></span><span>  </span><span id="local-6989586621681207791"><span class="annot"><span class="annottext">Maybe Module
</span><a href="#local-6989586621681207791"><span class="hs-identifier hs-var">home</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; m (Maybe Module)
forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m (Maybe Module)
</span><a href="GHC.html#lookupLoadedHomeModule"><span class="hs-identifier hs-var">lookupLoadedHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207793"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-1533"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="#local-6989586621681207791"><span class="hs-identifier hs-var">home</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1534"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207790"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207790"><span class="hs-identifier hs-var">m</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; m Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207790"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1535"></span><span>    </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO Module -&gt; m Module
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Module -&gt; m Module) -&gt; IO Module -&gt; m Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1536"></span><span>      </span><span id="local-6989586621681207789"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207789"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier hs-var">findExposedPackageModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207792"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207793"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1537"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207789"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1538"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-type">Found</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681207787"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207787"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; IO Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207787"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1539"></span><span>        </span><span id="local-6989586621681207786"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207786"><span class="hs-identifier hs-var">err</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WarnMsg -&gt; IO Module
forall (io :: * -&gt; *) a. MonadIO io =&gt; WarnMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwOneError"><span class="hs-identifier hs-var">throwOneError</span></a></span><span> </span><span class="annot"><span class="annottext">(WarnMsg -&gt; IO Module) -&gt; WarnMsg -&gt; IO Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; ModuleName -&gt; FindResult -&gt; WarnMsg
</span><a href="GHC.Driver.Make.html#noModError"><span class="hs-identifier hs-var">noModError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207792"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207793"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681207786"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-1540"></span><span>
</span><span id="line-1541"></span><span id="local-6989586621681209551"><span class="annot"><a href="GHC.html#lookupLoadedHomeModule"><span class="hs-identifier hs-type">lookupLoadedHomeModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1542"></span><span id="lookupLoadedHomeModule"><span class="annot"><span class="annottext">lookupLoadedHomeModule :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModuleName -&gt; m (Maybe Module)
</span><a href="GHC.html#lookupLoadedHomeModule"><span class="hs-identifier hs-var hs-var">lookupLoadedHomeModule</span></a></span></span><span> </span><span id="local-6989586621681207777"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207777"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe Module)) -&gt; m (Maybe Module)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe Module)) -&gt; m (Maybe Module))
-&gt; (HscEnv -&gt; m (Maybe Module)) -&gt; m (Maybe Module)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207776"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207776"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1543"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207776"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681207777"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1544"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207775"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681207775"><span class="hs-identifier hs-var">mod_info</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Module -&gt; m (Maybe Module)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Maybe Module
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModIface -&gt; Module
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; Module
</span><a href="GHC.Driver.Types.html#mi_module"><span class="hs-identifier hs-var hs-var">mi_module</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681207775"><span class="hs-identifier hs-var">mod_info</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1545"></span><span>    </span><span id="local-6989586621681207773"><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><a href="#local-6989586621681207773"><span class="hs-identifier hs-var">_not_a_home_module</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Module -&gt; m (Maybe Module)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Module
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1546"></span><span>
</span><span id="line-1547"></span><span class="hs-comment">-- | Check that a module is safe to import (according to Safe Haskell).</span><span>
</span><span id="line-1548"></span><span class="hs-comment">--</span><span>
</span><span id="line-1549"></span><span class="hs-comment">-- We return True to indicate the import is safe and False otherwise</span><span>
</span><span id="line-1550"></span><span class="hs-comment">-- although in the False case an error may be thrown first.</span><span>
</span><span id="line-1551"></span><span id="local-6989586621681209543"><span class="annot"><a href="GHC.html#isModuleTrusted"><span class="hs-identifier hs-type">isModuleTrusted</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-1552"></span><span id="isModuleTrusted"><span class="annot"><span class="annottext">isModuleTrusted :: forall (m :: * -&gt; *). GhcMonad m =&gt; Module -&gt; m Bool
</span><a href="GHC.html#isModuleTrusted"><span class="hs-identifier hs-var hs-var">isModuleTrusted</span></a></span></span><span> </span><span id="local-6989586621681207767"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207767"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Bool) -&gt; m Bool
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Bool) -&gt; m Bool) -&gt; (HscEnv -&gt; m Bool) -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207766"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207766"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1553"></span><span>    </span><span class="annot"><span class="annottext">IO Bool -&gt; m Bool
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Bool -&gt; m Bool) -&gt; IO Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; SrcSpan -&gt; IO Bool
</span><a href="GHC.Driver.Main.html#hscCheckSafe"><span class="hs-identifier hs-var">hscCheckSafe</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207766"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207767"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-1554"></span><span>
</span><span id="line-1555"></span><span class="hs-comment">-- | Return if a module is trusted and the pkgs it depends on to be trusted.</span><span>
</span><span id="line-1556"></span><span id="local-6989586621681209541"><span class="annot"><a href="GHC.html#moduleTrustReqs"><span class="hs-identifier hs-type">moduleTrustReqs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209541"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209541"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1557"></span><span id="moduleTrustReqs"><span class="annot"><span class="annottext">moduleTrustReqs :: forall (m :: * -&gt; *). GhcMonad m =&gt; Module -&gt; m (Bool, Set UnitId)
</span><a href="GHC.html#moduleTrustReqs"><span class="hs-identifier hs-var hs-var">moduleTrustReqs</span></a></span></span><span> </span><span id="local-6989586621681207759"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207759"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Bool, Set UnitId)) -&gt; m (Bool, Set UnitId)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Bool, Set UnitId)) -&gt; m (Bool, Set UnitId))
-&gt; (HscEnv -&gt; m (Bool, Set UnitId)) -&gt; m (Bool, Set UnitId)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207758"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207758"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1558"></span><span>    </span><span class="annot"><span class="annottext">IO (Bool, Set UnitId) -&gt; m (Bool, Set UnitId)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Bool, Set UnitId) -&gt; m (Bool, Set UnitId))
-&gt; IO (Bool, Set UnitId) -&gt; m (Bool, Set UnitId)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; SrcSpan -&gt; IO (Bool, Set UnitId)
</span><a href="GHC.Driver.Main.html#hscGetSafe"><span class="hs-identifier hs-var">hscGetSafe</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207758"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681207759"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-1559"></span><span>
</span><span id="line-1560"></span><span class="hs-comment">-- | Set the monad GHCi lifts user statements into.</span><span>
</span><span id="line-1561"></span><span class="hs-comment">--</span><span>
</span><span id="line-1562"></span><span class="hs-comment">-- Checks that a type (in string form) is an instance of the</span><span>
</span><span id="line-1563"></span><span class="hs-comment">-- @GHC.GHCi.GHCiSandboxIO@ type class. Sets it to be the GHCi monad if it is,</span><span>
</span><span id="line-1564"></span><span class="hs-comment">-- throws an error otherwise.</span><span>
</span><span id="line-1565"></span><span id="local-6989586621681209538"><span class="annot"><a href="GHC.html#setGHCiMonad"><span class="hs-identifier hs-type">setGHCiMonad</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209538"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209538"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-1566"></span><span id="setGHCiMonad"><span class="annot"><span class="annottext">setGHCiMonad :: forall (m :: * -&gt; *). GhcMonad m =&gt; FilePath -&gt; m ()
</span><a href="GHC.html#setGHCiMonad"><span class="hs-identifier hs-var hs-var">setGHCiMonad</span></a></span></span><span> </span><span id="local-6989586621681207746"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207746"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ()) -&gt; m ()
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m ()) -&gt; m ()) -&gt; (HscEnv -&gt; m ()) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207745"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207745"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1567"></span><span>    </span><span id="local-6989586621681207744"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681207744"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Name -&gt; m Name
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Name -&gt; m Name) -&gt; IO Name -&gt; m Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FilePath -&gt; IO Name
</span><a href="GHC.Driver.Main.html#hscIsGHCiMonad"><span class="hs-identifier hs-var">hscIsGHCiMonad</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207745"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207746"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1568"></span><span>    </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207742"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207742"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1569"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681207741"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681207741"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207742"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_monad :: Name
</span><a href="GHC.Driver.Types.html#ic_monad"><span class="hs-identifier hs-var">ic_monad</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681207744"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1570"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207742"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681207741"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1571"></span><span>
</span><span id="line-1572"></span><span class="hs-comment">-- | Get the monad GHCi lifts user statements into.</span><span>
</span><span id="line-1573"></span><span id="local-6989586621681209536"><span class="annot"><a href="GHC.html#getGHCiMonad"><span class="hs-identifier hs-type">getGHCiMonad</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span><span>
</span><span id="line-1574"></span><span id="getGHCiMonad"><span class="annot"><span class="annottext">getGHCiMonad :: forall (m :: * -&gt; *). GhcMonad m =&gt; m Name
</span><a href="GHC.html#getGHCiMonad"><span class="hs-identifier hs-var hs-var">getGHCiMonad</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; Name) -&gt; m HscEnv -&gt; m Name
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InteractiveContext -&gt; Name
</span><a href="GHC.Driver.Types.html#ic_monad"><span class="hs-identifier hs-var hs-var">ic_monad</span></a></span><span> </span><span class="annot"><span class="annottext">(InteractiveContext -&gt; Name)
-&gt; (HscEnv -&gt; InteractiveContext) -&gt; HscEnv -&gt; Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1575"></span><span>
</span><span id="line-1576"></span><span id="local-6989586621681209534"><span class="annot"><a href="GHC.html#getHistorySpan"><span class="hs-identifier hs-type">getHistorySpan</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209534"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209534"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span></span><span>
</span><span id="line-1577"></span><span id="getHistorySpan"><span class="annot"><span class="annottext">getHistorySpan :: forall (m :: * -&gt; *). GhcMonad m =&gt; History -&gt; m SrcSpan
</span><a href="GHC.html#getHistorySpan"><span class="hs-identifier hs-var hs-var">getHistorySpan</span></a></span></span><span> </span><span id="local-6989586621681207728"><span class="annot"><span class="annottext">History
</span><a href="#local-6989586621681207728"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m SrcSpan) -&gt; m SrcSpan
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m SrcSpan) -&gt; m SrcSpan)
-&gt; (HscEnv -&gt; m SrcSpan) -&gt; m SrcSpan
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207727"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207727"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1578"></span><span>    </span><span class="annot"><span class="annottext">SrcSpan -&gt; m SrcSpan
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; m SrcSpan) -&gt; SrcSpan -&gt; m SrcSpan
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; History -&gt; SrcSpan
</span><a href="GHC.Runtime.Eval.html#getHistorySpan"><span class="hs-identifier hs-var">GHC.Runtime.Eval.getHistorySpan</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207727"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">History
</span><a href="#local-6989586621681207728"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-1579"></span><span>
</span><span id="line-1580"></span><span id="local-6989586621681209530"><span id="local-6989586621681209531"><span class="annot"><a href="GHC.html#obtainTermFromVal"><span class="hs-identifier hs-type">obtainTermFromVal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209531"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209530"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209531"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span></span><span>
</span><span id="line-1581"></span><span id="obtainTermFromVal"><span class="annot"><span class="annottext">obtainTermFromVal :: forall (m :: * -&gt; *) a.
GhcMonad m =&gt;
Int -&gt; Bool -&gt; Type -&gt; a -&gt; m Term
</span><a href="GHC.html#obtainTermFromVal"><span class="hs-identifier hs-var hs-var">obtainTermFromVal</span></a></span></span><span> </span><span id="local-6989586621681207720"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207720"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681207719"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207719"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681207718"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681207718"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681207717"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681207717"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Term) -&gt; m Term) -&gt; (HscEnv -&gt; m Term) -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207716"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207716"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1582"></span><span>    </span><span class="annot"><span class="annottext">IO Term -&gt; m Term
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Term -&gt; m Term) -&gt; IO Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Bool -&gt; Type -&gt; a -&gt; IO Term
forall a. HscEnv -&gt; Int -&gt; Bool -&gt; Type -&gt; a -&gt; IO Term
</span><a href="GHC.Runtime.Eval.html#obtainTermFromVal"><span class="hs-identifier hs-var">GHC.Runtime.Eval.obtainTermFromVal</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207716"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207720"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207719"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681207718"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681207717"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1583"></span><span>
</span><span id="line-1584"></span><span id="local-6989586621681209525"><span class="annot"><a href="GHC.html#obtainTermFromId"><span class="hs-identifier hs-type">obtainTermFromId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681209525"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681209525"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span><span>
</span><span id="line-1585"></span><span id="obtainTermFromId"><span class="annot"><span class="annottext">obtainTermFromId :: forall (m :: * -&gt; *). GhcMonad m =&gt; Int -&gt; Bool -&gt; Var -&gt; m Term
</span><a href="GHC.html#obtainTermFromId"><span class="hs-identifier hs-var hs-var">obtainTermFromId</span></a></span></span><span> </span><span id="local-6989586621681207709"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207709"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681207708"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207708"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681207707"><span class="annot"><span class="annottext">Var
</span><a href="#local-6989586621681207707"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Term) -&gt; m Term) -&gt; (HscEnv -&gt; m Term) -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207706"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207706"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1586"></span><span>    </span><span class="annot"><span class="annottext">IO Term -&gt; m Term
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Term -&gt; m Term) -&gt; IO Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Bool -&gt; Var -&gt; IO Term
</span><a href="GHC.Runtime.Eval.html#obtainTermFromId"><span class="hs-identifier hs-var">GHC.Runtime.Eval.obtainTermFromId</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207706"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681207709"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207708"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">Var
</span><a href="#local-6989586621681207707"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1587"></span><span>
</span><span id="line-1588"></span><span>
</span><span id="line-1589"></span><span class="hs-comment">-- | Returns the 'TyThing' for a 'Name'.  The 'Name' may refer to any</span><span>
</span><span id="line-1590"></span><span class="hs-comment">-- entity known to GHC, including 'Name's defined using 'runStmt'.</span><span>
</span><span id="line-1591"></span><span id="local-6989586621681207704"><span class="annot"><a href="GHC.html#lookupName"><span class="hs-identifier hs-type">lookupName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681207704"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681207704"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1592"></span><span id="lookupName"><span class="annot"><span class="annottext">lookupName :: forall (m :: * -&gt; *). GhcMonad m =&gt; Name -&gt; m (Maybe TyThing)
</span><a href="GHC.html#lookupName"><span class="hs-identifier hs-var hs-var">lookupName</span></a></span></span><span> </span><span id="local-6989586621681207698"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681207698"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1593"></span><span>     </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing))
-&gt; (HscEnv -&gt; m (Maybe TyThing)) -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207697"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207697"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1594"></span><span>       </span><span class="annot"><span class="annottext">IO (Maybe TyThing) -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe TyThing) -&gt; m (Maybe TyThing))
-&gt; IO (Maybe TyThing) -&gt; m (Maybe TyThing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO (Maybe TyThing)
</span><a href="GHC.Driver.Main.html#hscTcRcLookupName"><span class="hs-identifier hs-var">hscTcRcLookupName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681207697"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681207698"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1595"></span><span>
</span><span id="line-1596"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1597"></span><span class="hs-comment">-- Pure API</span><span>
</span><span id="line-1598"></span><span>
</span><span id="line-1599"></span><span class="hs-comment">-- | A pure interface to the module parser.</span><span>
</span><span id="line-1600"></span><span class="hs-comment">--</span><span>
</span><span id="line-1601"></span><span class="annot"><a href="GHC.html#parser"><span class="hs-identifier hs-type">parser</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>         </span><span class="hs-comment">-- ^ Haskell module source text (full Unicode is supported)</span><span>
</span><span id="line-1602"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>       </span><span class="hs-comment">-- ^ the flags</span><span>
</span><span id="line-1603"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>       </span><span class="hs-comment">-- ^ the filename (for source locations)</span><span>
</span><span id="line-1604"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#WarningMessages"><span class="hs-identifier hs-type">WarningMessages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrorMessages"><span class="hs-identifier hs-type">ErrorMessages</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.html#HsModule"><span class="hs-identifier hs-type">HsModule</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1605"></span><span>
</span><span id="line-1606"></span><span id="parser"><span class="annot"><span class="annottext">parser :: FilePath
-&gt; DynFlags
-&gt; FilePath
-&gt; (Bag WarnMsg, Either (Bag WarnMsg) ParsedSource)
</span><a href="GHC.html#parser"><span class="hs-identifier hs-var hs-var">parser</span></a></span></span><span> </span><span id="local-6989586621681207693"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207693"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621681207692"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207692"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681207691"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207691"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1607"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-1608"></span><span>       </span><span id="local-6989586621681207690"><span class="annot"><span class="annottext">loc :: RealSrcLoc
</span><a href="#local-6989586621681207690"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207691"><span class="hs-identifier hs-var">filename</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1609"></span><span>       </span><span id="local-6989586621681207689"><span class="annot"><span class="annottext">buf :: InputFileBuffer
</span><a href="#local-6989586621681207689"><span class="hs-identifier hs-var hs-var">buf</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; InputFileBuffer
</span><a href="GHC.Data.StringBuffer.html#stringToStringBuffer"><span class="hs-identifier hs-var">stringToStringBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207693"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-1610"></span><span>   </span><span class="hs-keyword">in</span><span>
</span><span id="line-1611"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P ParsedSource -&gt; PState -&gt; ParseResult ParsedSource
forall a. P a -&gt; PState -&gt; ParseResult a
</span><a href="GHC.Parser.Lexer.html#unP"><span class="hs-identifier hs-var hs-var">unP</span></a></span><span> </span><span class="annot"><span class="annottext">P ParsedSource
</span><a href="GHC.Parser.html#parseModule"><span class="hs-identifier hs-var">Parser.parseModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; InputFileBuffer -&gt; RealSrcLoc -&gt; PState
</span><a href="GHC.Parser.Lexer.html#mkPState"><span class="hs-identifier hs-var">mkPState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207692"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">InputFileBuffer
</span><a href="#local-6989586621681207689"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681207690"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1612"></span><span>
</span><span id="line-1613"></span><span>     </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">PFailed</span></a></span><span> </span><span id="local-6989586621681207684"><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207684"><span class="hs-identifier hs-var">pst</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1614"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681207683"><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207683"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681207682"><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207682"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PState -&gt; DynFlags -&gt; Messages
</span><a href="GHC.Parser.Lexer.html#getMessages"><span class="hs-identifier hs-var">getMessages</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207684"><span class="hs-identifier hs-var">pst</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207692"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-1615"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207683"><span class="hs-identifier hs-var">warns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag WarnMsg -&gt; Either (Bag WarnMsg) ParsedSource
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207682"><span class="hs-identifier hs-var">errs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1616"></span><span>
</span><span id="line-1617"></span><span>     </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">POk</span></a></span><span> </span><span id="local-6989586621681207680"><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207680"><span class="hs-identifier hs-var">pst</span></a></span></span><span> </span><span id="local-6989586621681207679"><span class="annot"><span class="annottext">ParsedSource
</span><a href="#local-6989586621681207679"><span class="hs-identifier hs-var">rdr_module</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1618"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681207678"><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207678"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Bag WarnMsg
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PState -&gt; DynFlags -&gt; Messages
</span><a href="GHC.Parser.Lexer.html#getMessages"><span class="hs-identifier hs-var">getMessages</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681207680"><span class="hs-identifier hs-var">pst</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207692"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-1619"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag WarnMsg
</span><a href="#local-6989586621681207678"><span class="hs-identifier hs-var">warns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ParsedSource -&gt; Either (Bag WarnMsg) ParsedSource
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedSource
</span><a href="#local-6989586621681207679"><span class="hs-identifier hs-var">rdr_module</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1620"></span><span>
</span><span id="line-1621"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1622"></span><span class="hs-comment">-- | Find the package environment (if one exists)</span><span>
</span><span id="line-1623"></span><span class="hs-comment">--</span><span>
</span><span id="line-1624"></span><span class="hs-comment">-- We interpret the package environment as a set of package flags; to be</span><span>
</span><span id="line-1625"></span><span class="hs-comment">-- specific, if we find a package environment file like</span><span>
</span><span id="line-1626"></span><span class="hs-comment">--</span><span>
</span><span id="line-1627"></span><span class="hs-comment">-- &gt; clear-package-db</span><span>
</span><span id="line-1628"></span><span class="hs-comment">-- &gt; global-package-db</span><span>
</span><span id="line-1629"></span><span class="hs-comment">-- &gt; package-db blah/package.conf.d</span><span>
</span><span id="line-1630"></span><span class="hs-comment">-- &gt; package-id id1</span><span>
</span><span id="line-1631"></span><span class="hs-comment">-- &gt; package-id id2</span><span>
</span><span id="line-1632"></span><span class="hs-comment">--</span><span>
</span><span id="line-1633"></span><span class="hs-comment">-- we interpret this as</span><span>
</span><span id="line-1634"></span><span class="hs-comment">--</span><span>
</span><span id="line-1635"></span><span class="hs-comment">-- &gt; [ -hide-all-packages</span><span>
</span><span id="line-1636"></span><span class="hs-comment">-- &gt; , -clear-package-db</span><span>
</span><span id="line-1637"></span><span class="hs-comment">-- &gt; , -global-package-db</span><span>
</span><span id="line-1638"></span><span class="hs-comment">-- &gt; , -package-db blah/package.conf.d</span><span>
</span><span id="line-1639"></span><span class="hs-comment">-- &gt; , -package-id id1</span><span>
</span><span id="line-1640"></span><span class="hs-comment">-- &gt; , -package-id id2</span><span>
</span><span id="line-1641"></span><span class="hs-comment">-- &gt; ]</span><span>
</span><span id="line-1642"></span><span class="hs-comment">--</span><span>
</span><span id="line-1643"></span><span class="hs-comment">-- There's also an older syntax alias for package-id, which is just an</span><span>
</span><span id="line-1644"></span><span class="hs-comment">-- unadorned package id</span><span>
</span><span id="line-1645"></span><span class="hs-comment">--</span><span>
</span><span id="line-1646"></span><span class="hs-comment">-- &gt; id1</span><span>
</span><span id="line-1647"></span><span class="hs-comment">-- &gt; id2</span><span>
</span><span id="line-1648"></span><span class="hs-comment">--</span><span>
</span><span id="line-1649"></span><span class="annot"><a href="GHC.html#interpretPackageEnv"><span class="hs-identifier hs-type">interpretPackageEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-1650"></span><span id="interpretPackageEnv"><span class="annot"><span class="annottext">interpretPackageEnv :: DynFlags -&gt; IO DynFlags
</span><a href="GHC.html#interpretPackageEnv"><span class="hs-identifier hs-var hs-var">interpretPackageEnv</span></a></span></span><span> </span><span id="local-6989586621681207677"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1651"></span><span>    </span><span id="local-6989586621681207676"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681207676"><span class="hs-identifier hs-var">mPkgEnv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO FilePath -&gt; IO (Maybe FilePath))
-&gt; MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[MaybeT IO FilePath] -&gt; MaybeT IO FilePath
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, MonadPlus m) =&gt;
t (m a) -&gt; m a
</span><a href="../../base/src/Data.Foldable.html#msum"><span class="hs-identifier hs-var">msum</span></a></span><span> </span><span class="annot"><span class="annottext">([MaybeT IO FilePath] -&gt; MaybeT IO FilePath)
-&gt; [MaybeT IO FilePath] -&gt; MaybeT IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-1652"></span><span>                   </span><span class="annot"><span class="annottext">MaybeT IO FilePath
</span><a href="#local-6989586621681207673"><span class="hs-identifier hs-var">getCmdLineArg</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
-&gt; (FilePath -&gt; MaybeT IO FilePath) -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207672"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207672"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[MaybeT IO FilePath] -&gt; MaybeT IO FilePath
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, MonadPlus m) =&gt;
t (m a) -&gt; m a
</span><a href="../../base/src/Data.Foldable.html#msum"><span class="hs-identifier hs-var">msum</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-1653"></span><span>                       </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207671"><span class="hs-identifier hs-var">probeNullEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207672"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1654"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207670"><span class="hs-identifier hs-var">probeEnvFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207672"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1655"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207669"><span class="hs-identifier hs-var">probeEnvName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207672"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1656"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall a. FilePath -&gt; MaybeT IO a
</span><a href="#local-6989586621681207668"><span class="hs-identifier hs-var">cmdLineError</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207672"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1657"></span><span>                     </span><span class="hs-special">]</span><span>
</span><span id="line-1658"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
</span><a href="#local-6989586621681207667"><span class="hs-identifier hs-var">getEnvVar</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
-&gt; (FilePath -&gt; MaybeT IO FilePath) -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681207666"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207666"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[MaybeT IO FilePath] -&gt; MaybeT IO FilePath
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, MonadPlus m) =&gt;
t (m a) -&gt; m a
</span><a href="../../base/src/Data.Foldable.html#msum"><span class="hs-identifier hs-var">msum</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-1659"></span><span>                       </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207671"><span class="hs-identifier hs-var">probeNullEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207666"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1660"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207670"><span class="hs-identifier hs-var">probeEnvFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207666"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1661"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207669"><span class="hs-identifier hs-var">probeEnvName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207666"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1662"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall a. FilePath -&gt; MaybeT IO a
</span><a href="#local-6989586621681207665"><span class="hs-identifier hs-var">envError</span></a></span><span>     </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207666"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1663"></span><span>                     </span><span class="hs-special">]</span><span>
</span><span id="line-1664"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MaybeT IO ()
</span><a href="#local-6989586621681207664"><span class="hs-identifier hs-var">notIfHideAllPackages</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO () -&gt; MaybeT IO FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[MaybeT IO FilePath] -&gt; MaybeT IO FilePath
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, MonadPlus m) =&gt;
t (m a) -&gt; m a
</span><a href="../../base/src/Data.Foldable.html#msum"><span class="hs-identifier hs-var">msum</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-1665"></span><span>                       </span><span class="annot"><span class="annottext">MaybeT IO FilePath
</span><a href="#local-6989586621681207663"><span class="hs-identifier hs-var">findLocalEnvFile</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
-&gt; (FilePath -&gt; MaybeT IO FilePath) -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207670"><span class="hs-identifier hs-var">probeEnvFile</span></a></span><span>
</span><span id="line-1666"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207669"><span class="hs-identifier hs-var">probeEnvName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207662"><span class="hs-identifier hs-var">defaultEnvName</span></a></span><span>
</span><span id="line-1667"></span><span>                     </span><span class="hs-special">]</span><span>
</span><span id="line-1668"></span><span>                 </span><span class="hs-special">]</span><span>
</span><span id="line-1669"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681207676"><span class="hs-identifier hs-var">mPkgEnv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1670"></span><span>      </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1671"></span><span>        </span><span class="hs-comment">-- No environment found. Leave DynFlags unchanged.</span><span>
</span><span id="line-1672"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1673"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1674"></span><span>        </span><span class="hs-comment">-- Explicitly disabled environment file. Leave DynFlags unchanged.</span><span>
</span><span id="line-1675"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1676"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681207661"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207661"><span class="hs-identifier hs-var">envfile</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1677"></span><span>        </span><span id="local-6989586621681207660"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207660"><span class="hs-identifier hs-var">content</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
</span><a href="../../base/src/System.IO.html#readFile"><span class="hs-identifier hs-var">readFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207661"><span class="hs-identifier hs-var">envfile</span></a></span><span>
</span><span id="line-1678"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; FatalMessager
</span><a href="GHC.Utils.Error.html#compilationProgressMsg"><span class="hs-identifier hs-var">compilationProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Loaded package environment from &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207661"><span class="hs-identifier hs-var">envfile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1679"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Errs, Warns, ())
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681207657"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207657"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdLineP DynFlags (Errs, Warns, ())
-&gt; DynFlags -&gt; ((Errs, Warns, ()), DynFlags)
forall s a. CmdLineP s a -&gt; s -&gt; (a, s)
</span><a href="GHC.Driver.CmdLine.html#runCmdLine"><span class="hs-identifier hs-var hs-var">runCmdLine</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EwM (CmdLineP DynFlags) () -&gt; CmdLineP DynFlags (Errs, Warns, ())
forall (m :: * -&gt; *) a. EwM m a -&gt; m (Errs, Warns, a)
</span><a href="GHC.Driver.CmdLine.html#runEwM"><span class="hs-identifier hs-var">runEwM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; EwM (CmdLineP DynFlags) ()
</span><a href="GHC.Driver.Session.html#setFlagsFromEnvFile"><span class="hs-identifier hs-var">setFlagsFromEnvFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207661"><span class="hs-identifier hs-var">envfile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207660"><span class="hs-identifier hs-var">content</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1680"></span><span>
</span><span id="line-1681"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; IO DynFlags
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207657"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-1682"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1683"></span><span>    </span><span class="hs-comment">-- Loading environments (by name or by location)</span><span>
</span><span id="line-1684"></span><span>
</span><span id="line-1685"></span><span>    </span><span id="local-6989586621681207653"><span class="annot"><span class="annottext">platformArchOs :: PlatformMini
</span><a href="#local-6989586621681207653"><span class="hs-identifier hs-var hs-var">platformArchOs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; PlatformMini
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMini"><span class="hs-identifier hs-var hs-var">platformMini</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1686"></span><span>
</span><span id="line-1687"></span><span>    </span><span class="annot"><a href="#local-6989586621681207651"><span class="hs-identifier hs-type">namedEnvPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1688"></span><span>    </span><span id="local-6989586621681207651"><span class="annot"><span class="annottext">namedEnvPath :: FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207651"><span class="hs-identifier hs-var hs-var">namedEnvPath</span></a></span></span><span> </span><span id="local-6989586621681207650"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207650"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1689"></span><span>     </span><span id="local-6989586621681207649"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207649"><span class="hs-identifier hs-var">appdir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; PlatformMini -&gt; MaybeT IO FilePath
</span><a href="GHC.Driver.Session.html#versionedAppDir"><span class="hs-identifier hs-var">versionedAppDir</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath
</span><a href="GHC.Driver.Session.html#programName"><span class="hs-identifier hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">PlatformMini
</span><a href="#local-6989586621681207653"><span class="hs-identifier hs-var">platformArchOs</span></a></span><span>
</span><span id="line-1690"></span><span>     </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; MaybeT IO FilePath) -&gt; FilePath -&gt; MaybeT IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207649"><span class="hs-identifier hs-var">appdir</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;environments&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207650"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1691"></span><span>
</span><span id="line-1692"></span><span>    </span><span class="annot"><a href="#local-6989586621681207669"><span class="hs-identifier hs-type">probeEnvName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1693"></span><span>    </span><span id="local-6989586621681207669"><span class="annot"><span class="annottext">probeEnvName :: FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207669"><span class="hs-identifier hs-var hs-var">probeEnvName</span></a></span></span><span> </span><span id="local-6989586621681207645"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207645"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207670"><span class="hs-identifier hs-var">probeEnvFile</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; MaybeT IO FilePath)
-&gt; MaybeT IO FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207651"><span class="hs-identifier hs-var">namedEnvPath</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207645"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1694"></span><span>
</span><span id="line-1695"></span><span>    </span><span class="annot"><a href="#local-6989586621681207670"><span class="hs-identifier hs-type">probeEnvFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1696"></span><span>    </span><span id="local-6989586621681207670"><span class="annot"><span class="annottext">probeEnvFile :: FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207670"><span class="hs-identifier hs-var hs-var">probeEnvFile</span></a></span></span><span> </span><span id="local-6989586621681207644"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207644"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1697"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; MaybeT IO ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; MaybeT IO ()) -&gt; MaybeT IO Bool -&gt; MaybeT IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; MaybeT IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207644"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1698"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207644"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-1699"></span><span>
</span><span id="line-1700"></span><span>    </span><span class="annot"><a href="#local-6989586621681207671"><span class="hs-identifier hs-type">probeNullEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1701"></span><span>    </span><span id="local-6989586621681207671"><span class="annot"><span class="annottext">probeNullEnv :: FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207671"><span class="hs-identifier hs-var hs-var">probeNullEnv</span></a></span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-&quot;</span></span><span>
</span><span id="line-1702"></span><span>    </span><span class="annot"><a href="#local-6989586621681207671"><span class="hs-identifier hs-var">probeNullEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-1703"></span><span>
</span><span id="line-1704"></span><span>    </span><span class="hs-comment">-- Various ways to define which environment to use</span><span>
</span><span id="line-1705"></span><span>
</span><span id="line-1706"></span><span>    </span><span class="annot"><a href="#local-6989586621681207673"><span class="hs-identifier hs-type">getCmdLineArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1707"></span><span>    </span><span id="local-6989586621681207673"><span class="annot"><span class="annottext">getCmdLineArg :: MaybeT IO FilePath
</span><a href="#local-6989586621681207673"><span class="hs-identifier hs-var hs-var">getCmdLineArg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Maybe FilePath) -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe FilePath) -&gt; MaybeT IO FilePath)
-&gt; IO (Maybe FilePath) -&gt; MaybeT IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FilePath -&gt; IO (Maybe FilePath))
-&gt; Maybe FilePath -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#packageEnv"><span class="hs-identifier hs-var hs-var">packageEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1708"></span><span>
</span><span id="line-1709"></span><span>    </span><span class="annot"><a href="#local-6989586621681207667"><span class="hs-identifier hs-type">getEnvVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1710"></span><span>    </span><span id="local-6989586621681207667"><span class="annot"><span class="annottext">getEnvVar :: MaybeT IO FilePath
</span><a href="#local-6989586621681207667"><span class="hs-identifier hs-var hs-var">getEnvVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1711"></span><span>      </span><span id="local-6989586621681207639"><span class="annot"><span class="annottext">Either IOError FilePath
</span><a href="#local-6989586621681207639"><span class="hs-identifier hs-var">mvar</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Either IOError FilePath) -&gt; MaybeT IO (Either IOError FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Either IOError FilePath)
 -&gt; MaybeT IO (Either IOError FilePath))
-&gt; IO (Either IOError FilePath)
-&gt; MaybeT IO (Either IOError FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO FilePath -&gt; IO (Either IOError FilePath)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; m (Either e a)
</span><a href="../../exceptions/src/Control.Monad.Catch.html#try"><span class="hs-identifier hs-var">MC.try</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FilePath -&gt; IO (Either IOError FilePath))
-&gt; IO FilePath -&gt; IO (Either IOError FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
</span><a href="../../base/src/System.Environment.html#getEnv"><span class="hs-identifier hs-var">getEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;GHC_ENVIRONMENT&quot;</span></span><span>
</span><span id="line-1712"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either IOError FilePath
</span><a href="#local-6989586621681207639"><span class="hs-identifier hs-var">mvar</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1713"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681207637"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207637"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207637"><span class="hs-identifier hs-var">var</span></a></span><span>
</span><span id="line-1714"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681207636"><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621681207636"><span class="hs-identifier hs-var">err</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOError -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isDoesNotExistError"><span class="hs-identifier hs-var">isDoesNotExistError</span></a></span><span> </span><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621681207636"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-1715"></span><span>                                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IO FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FilePath -&gt; MaybeT IO FilePath)
-&gt; IO FilePath -&gt; MaybeT IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOError -&gt; IO FilePath
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621681207636"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-1716"></span><span>
</span><span id="line-1717"></span><span>    </span><span class="annot"><a href="#local-6989586621681207664"><span class="hs-identifier hs-type">notIfHideAllPackages</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1718"></span><span>    </span><span id="local-6989586621681207664"><span class="annot"><span class="annottext">notIfHideAllPackages :: MaybeT IO ()
</span><a href="#local-6989586621681207664"><span class="hs-identifier hs-var hs-var">notIfHideAllPackages</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1719"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; MaybeT IO ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_HideAllPackages"><span class="hs-identifier hs-var">Opt_HideAllPackages</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681207677"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1720"></span><span>
</span><span id="line-1721"></span><span>    </span><span class="annot"><a href="#local-6989586621681207662"><span class="hs-identifier hs-type">defaultEnvName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1722"></span><span>    </span><span id="local-6989586621681207662"><span class="annot"><span class="annottext">defaultEnvName :: FilePath
</span><a href="#local-6989586621681207662"><span class="hs-identifier hs-var hs-var">defaultEnvName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;default&quot;</span></span><span>
</span><span id="line-1723"></span><span>
</span><span id="line-1724"></span><span>    </span><span class="hs-comment">-- e.g. .ghc.environment.x86_64-linux-7.6.3</span><span>
</span><span id="line-1725"></span><span>    </span><span class="annot"><a href="#local-6989586621681207634"><span class="hs-identifier hs-type">localEnvFileName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1726"></span><span>    </span><span id="local-6989586621681207634"><span class="annot"><span class="annottext">localEnvFileName :: FilePath
</span><a href="#local-6989586621681207634"><span class="hs-identifier hs-var hs-var">localEnvFileName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;.ghc.environment&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PlatformMini -&gt; FilePath
</span><a href="GHC.Driver.Session.html#versionedFilePath"><span class="hs-identifier hs-var">versionedFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">PlatformMini
</span><a href="#local-6989586621681207653"><span class="hs-identifier hs-var">platformArchOs</span></a></span><span>
</span><span id="line-1727"></span><span>
</span><span id="line-1728"></span><span>    </span><span class="hs-comment">-- Search for an env file, starting in the current dir and looking upwards.</span><span>
</span><span id="line-1729"></span><span>    </span><span class="hs-comment">-- Fail if we get to the users home dir or the filesystem root. That is,</span><span>
</span><span id="line-1730"></span><span>    </span><span class="hs-comment">-- we don't look for an env file in the user's home dir. The user-wide</span><span>
</span><span id="line-1731"></span><span>    </span><span class="hs-comment">-- env lives in ghc's versionedAppDir/environments/default</span><span>
</span><span id="line-1732"></span><span>    </span><span class="annot"><a href="#local-6989586621681207663"><span class="hs-identifier hs-type">findLocalEnvFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1733"></span><span>    </span><span id="local-6989586621681207663"><span class="annot"><span class="annottext">findLocalEnvFile :: MaybeT IO FilePath
</span><a href="#local-6989586621681207663"><span class="hs-identifier hs-var hs-var">findLocalEnvFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1734"></span><span>        </span><span id="local-6989586621681207632"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207632"><span class="hs-identifier hs-var">curdir</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">IO FilePath
</span><a href="../../directory/src/System.Directory.html#getCurrentDirectory"><span class="hs-identifier hs-var">getCurrentDirectory</span></a></span><span>
</span><span id="line-1735"></span><span>        </span><span id="local-6989586621681207630"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207630"><span class="hs-identifier hs-var">homedir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO FilePath -&gt; MaybeT IO FilePath
forall a. IO a -&gt; MaybeT IO a
</span><a href="GHC.Data.Maybe.html#tryMaybeT"><span class="hs-identifier hs-var">tryMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">IO FilePath
</span><a href="../../directory/src/System.Directory.html#getHomeDirectory"><span class="hs-identifier hs-var">getHomeDirectory</span></a></span><span>
</span><span id="line-1736"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681207627"><span class="annot"><span class="annottext">probe :: FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207627"><span class="hs-identifier hs-var hs-var">probe</span></a></span></span><span> </span><span id="local-6989586621681207626"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207626"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isDrive"><span class="hs-identifier hs-var">isDrive</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207626"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207626"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207630"><span class="hs-identifier hs-var">homedir</span></a></span><span>
</span><span id="line-1737"></span><span>                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-1738"></span><span>            </span><span class="annot"><a href="#local-6989586621681207627"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span id="local-6989586621681207623"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207623"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1739"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681207622"><span class="annot"><span class="annottext">file :: FilePath
</span><a href="#local-6989586621681207622"><span class="hs-identifier hs-var hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207623"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207634"><span class="hs-identifier hs-var">localEnvFileName</span></a></span><span>
</span><span id="line-1740"></span><span>              </span><span id="local-6989586621681207621"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207621"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; MaybeT IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207622"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1741"></span><span>              </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681207621"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-1742"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207622"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-1743"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207627"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207623"><span class="hs-identifier hs-var">dir</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1744"></span><span>        </span><span class="annot"><span class="annottext">FilePath -&gt; MaybeT IO FilePath
</span><a href="#local-6989586621681207627"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207632"><span class="hs-identifier hs-var">curdir</span></a></span><span>
</span><span id="line-1745"></span><span>
</span><span id="line-1746"></span><span>    </span><span class="hs-comment">-- Error reporting</span><span>
</span><span id="line-1747"></span><span>
</span><span id="line-1748"></span><span>    </span><span id="local-6989586621681209513"><span class="annot"><a href="#local-6989586621681207668"><span class="hs-identifier hs-type">cmdLineError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681209513"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1749"></span><span>    </span><span id="local-6989586621681207668"><span class="annot"><span class="annottext">cmdLineError :: forall a. FilePath -&gt; MaybeT IO a
</span><a href="#local-6989586621681207668"><span class="hs-identifier hs-var hs-var">cmdLineError</span></a></span></span><span> </span><span id="local-6989586621681207614"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207614"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; MaybeT IO a
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; MaybeT IO a)
-&gt; (FilePath -&gt; IO a) -&gt; FilePath -&gt; MaybeT IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO a
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcException -&gt; IO a)
-&gt; (FilePath -&gt; GhcException) -&gt; FilePath -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#CmdLineError"><span class="hs-identifier hs-var">CmdLineError</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; MaybeT IO a) -&gt; FilePath -&gt; MaybeT IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1750"></span><span>      </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Package environment &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207614"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; not found&quot;</span></span><span>
</span><span id="line-1751"></span><span>
</span><span id="line-1752"></span><span>    </span><span id="local-6989586621681207613"><span class="annot"><a href="#local-6989586621681207665"><span class="hs-identifier hs-type">envError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681207613"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1753"></span><span>    </span><span id="local-6989586621681207665"><span class="annot"><span class="annottext">envError :: forall a. FilePath -&gt; MaybeT IO a
</span><a href="#local-6989586621681207665"><span class="hs-identifier hs-var hs-var">envError</span></a></span></span><span> </span><span id="local-6989586621681207609"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207609"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; MaybeT IO a
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; MaybeT m a
</span><a href="GHC.Data.Maybe.html#liftMaybeT"><span class="hs-identifier hs-var">liftMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; MaybeT IO a)
-&gt; (FilePath -&gt; IO a) -&gt; FilePath -&gt; MaybeT IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO a
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="annot"><span class="annottext">(GhcException -&gt; IO a)
-&gt; (FilePath -&gt; GhcException) -&gt; FilePath -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#CmdLineError"><span class="hs-identifier hs-var">CmdLineError</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; MaybeT IO a) -&gt; FilePath -&gt; MaybeT IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1754"></span><span>         </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Package environment &quot;</span></span><span>
</span><span id="line-1755"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681207609"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-1756"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; (specified in GHC_ENVIRONMENT) not found&quot;</span></span><span>
</span><span id="line-1757"></span></pre></body></html>